summaryrefslogtreecommitdiff
path: root/spec/migrations/20200107172020_add_timestamp_softwarelicensespolicy_spec.rb
blob: 1377d5e6ba04fd5a40d194a4f3729b4204a2afca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require 'spec_helper'
require Rails.root.join('db', 'migrate', '20200107172020_add_timestamp_softwarelicensespolicy.rb')

RSpec.describe AddTimestampSoftwarelicensespolicy 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)
  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