debian-mirror-gitlab/spec/migrations/remove_project_labels_group_id_spec.rb

22 lines
819 B
Ruby
Raw Normal View History

2018-03-17 18:26:18 +05:30
# encoding: utf-8
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20180202111106_remove_project_labels_group_id.rb')
describe RemoveProjectLabelsGroupId, :delete do
let(:migration) { described_class.new }
2018-05-09 12:01:36 +05:30
let(:group) { create(:group) } # rubocop:disable RSpec/FactoriesInMigrationSpecs
let!(:project_label) { create(:label, group_id: group.id) } # rubocop:disable RSpec/FactoriesInMigrationSpecs
let!(:group_label) { create(:group_label) } # rubocop:disable RSpec/FactoriesInMigrationSpecs
2018-03-17 18:26:18 +05:30
describe '#up' do
it 'updates the project labels group ID' do
expect { migration.up }.to change { project_label.reload.group_id }.to(nil)
end
it 'keeps the group labels group ID' do
expect { migration.up }.not_to change { group_label.reload.group_id }
end
end
end