Commit 3708bb50 authored by Robert Speicher's avatar Robert Speicher

Merge branch '11432-fix-gitlab-subscription-' into 'master'

Fix default value for start date in GitlabSubscription being static

Closes #11432

See merge request gitlab-org/gitlab-ee!12110
parents acad071c 3f020bf9
# frozen_string_literal: true
class GitlabSubscription < ApplicationRecord
default_value_for :start_date, Date.today
default_value_for(:start_date) { Date.today }
belongs_to :namespace
belongs_to :hosted_plan, class_name: 'Plan'
......
require 'spec_helper'
describe GitlabSubscription do
around do |example|
Timecop.freeze do
example.run
end
end
describe 'default values' do
it do
expect(subject.start_date).to eq(Date.today)
Timecop.freeze(Date.today + 30) do
expect(subject.start_date).to eq(Date.today)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment