2020-03-13 15:44:24 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
2021-09-04 01:27:46 +05:30
|
|
|
require_migration!('add_timestamp_softwarelicensespolicy')
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe AddTimestampSoftwarelicensespolicy do
|
2020-03-13 15:44:24 +05:30
|
|
|
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)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'creates timestamps' do
|
|
|
|
migrate!
|
|
|
|
|
|
|
|
expect(software_licenses_policy.first.created_at).to be_nil
|
|
|
|
expect(software_licenses_policy.first.updated_at).to be_nil
|
|
|
|
end
|
|
|
|
end
|