2018-02-02 10:56:38 +00:00
|
|
|
# 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 }
|
|
|
|
let(:group) { create(:group) }
|
|
|
|
let!(:project_label) { create(:label, group_id: group.id) }
|
|
|
|
let!(:group_label) { create(:group_label) }
|
|
|
|
|
|
|
|
describe '#up' do
|
|
|
|
it 'updates the project labels group ID' do
|
2018-02-02 12:18:16 +00:00
|
|
|
expect { migration.up }.to change { project_label.reload.group_id }.to(nil)
|
2018-02-02 10:56:38 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'keeps the group labels group ID' do
|
|
|
|
expect { migration.up }.not_to change { group_label.reload.group_id }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|