Commit e8aab1cd authored by Kamil Trzcinski's avatar Kamil Trzcinski

This fixes a long running tests due to changed Sidekiq state

parent 804fa437
...@@ -7,12 +7,13 @@ describe Admin::GroupsController do ...@@ -7,12 +7,13 @@ describe Admin::GroupsController do
before do before do
sign_in(admin) sign_in(admin)
Sidekiq::Testing.fake!
end end
describe 'DELETE #destroy' do describe 'DELETE #destroy' do
it 'schedules a group destroy' do it 'schedules a group destroy' do
expect { delete :destroy, id: project.group.path }.to change(GroupDestroyWorker.jobs, :size).by(1) Sidekiq::Testing.fake! do
expect { delete :destroy, id: project.group.path }.to change(GroupDestroyWorker.jobs, :size).by(1)
end
end end
it 'redirects to the admin group path' do it 'redirects to the admin group path' do
......
...@@ -89,12 +89,13 @@ describe GroupsController do ...@@ -89,12 +89,13 @@ describe GroupsController do
context 'as the group owner' do context 'as the group owner' do
before do before do
Sidekiq::Testing.fake!
sign_in(user) sign_in(user)
end end
it 'schedules a group destroy' do it 'schedules a group destroy' do
expect { delete :destroy, id: group.path }.to change(GroupDestroyWorker.jobs, :size).by(1) Sidekiq::Testing.fake! do
expect { delete :destroy, id: group.path }.to change(GroupDestroyWorker.jobs, :size).by(1)
end
end end
it 'redirects to the root path' do it 'redirects to the root path' do
......
...@@ -52,19 +52,20 @@ describe IrkerService, models: true do ...@@ -52,19 +52,20 @@ describe IrkerService, models: true do
let(:colorize_messages) { '1' } let(:colorize_messages) { '1' }
before do before do
@irker_server = TCPServer.new 'localhost', 0
allow(irker).to receive_messages( allow(irker).to receive_messages(
active: true, active: true,
project: project, project: project,
project_id: project.id, project_id: project.id,
service_hook: true, service_hook: true,
server_host: 'localhost', server_host: @irker_server.addr[2],
server_port: 6659, server_port: @irker_server.addr[1],
default_irc_uri: 'irc://chat.freenode.net/', default_irc_uri: 'irc://chat.freenode.net/',
recipients: recipients, recipients: recipients,
colorize_messages: colorize_messages) colorize_messages: colorize_messages)
irker.valid? irker.valid?
@irker_server = TCPServer.new 'localhost', 6659
end end
after do after do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment