diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 18:08:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 18:08:26 +0300 |
commit | c859c3bfd242288065fe5e2d887f7204f09e2335 (patch) | |
tree | 10febaf8774a3ea6ab3773c0dd97658d673fb280 /spec/migrations | |
parent | 28ce39a3e0e7b47e53939a15fb823af9c433327a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/migrations')
-rw-r--r-- | spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb b/spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb new file mode 100644 index 00000000000..539da8ac92a --- /dev/null +++ b/spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require 'spec_helper' + +require Rails.root.join('db', 'migrate', '20200116175538_update_timestamp_softwarelicensespolicy.rb') + +describe UpdateTimestampSoftwarelicensespolicy, :migration do + let(:software_licenses_policy) { table(:software_license_policies) } + let(:projects) { table(:projects) } + let(:licenses) { table(:software_licenses) } + + before do + projects.create!(name: 'gitlab', path: 'gitlab-org/gitlab-ce', namespace_id: 1) + licenses.create!(name: 'MIT') + software_licenses_policy.create!(project_id: projects.first.id, software_license_id: licenses.first.id, created_at: nil, updated_at: nil) + end + + it 'creates timestamps' do + migrate! + + expect(software_licenses_policy.first.created_at).to be_present + expect(software_licenses_policy.first.updated_at).to be_present + end +end |