diff options
Diffstat (limited to 'spec/migrations/20200313203550_remove_orphaned_chat_names_spec.rb')
-rw-r--r-- | spec/migrations/20200313203550_remove_orphaned_chat_names_spec.rb | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/spec/migrations/20200313203550_remove_orphaned_chat_names_spec.rb b/spec/migrations/20200313203550_remove_orphaned_chat_names_spec.rb deleted file mode 100644 index 6b1126ca53e..00000000000 --- a/spec/migrations/20200313203550_remove_orphaned_chat_names_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration!('remove_orphaned_chat_names') - -RSpec.describe RemoveOrphanedChatNames, schema: 20200313202430 do - let(:projects) { table(:projects) } - let(:namespaces) { table(:namespaces) } - let(:services) { table(:services) } - let(:chat_names) { table(:chat_names) } - - let(:namespace) { namespaces.create!(name: 'foo', path: 'foo') } - let(:project) { projects.create!(namespace_id: namespace.id) } - let(:service) { services.create!(project_id: project.id, type: 'chat') } - let(:chat_name) { chat_names.create!(service_id: service.id, team_id: 'TEAM', user_id: 12345, chat_id: 12345) } - let(:orphaned_chat_name) { chat_names.create!(team_id: 'TEAM', service_id: 0, user_id: 12345, chat_id: 12345) } - - it 'removes the orphaned chat_name' do - expect(chat_name).to be_present - expect(orphaned_chat_name).to be_present - - migrate! - - expect(chat_names.where(id: orphaned_chat_name.id)).to be_empty - expect(chat_name.reload).to be_present - end -end |