Commit 60288d6c authored by Lin Jen-Shin's avatar Lin Jen-Shin
parent 3856a3da
...@@ -31,16 +31,16 @@ describe Admin::RunnersController do ...@@ -31,16 +31,16 @@ describe Admin::RunnersController do
describe '#update' do describe '#update' do
it 'updates the runner and ticks the queue' do it 'updates the runner and ticks the queue' do
old_tick = runner.ensure_runner_queue_value
new_desc = runner.description.swapcase new_desc = runner.description.swapcase
expect do
post :update, id: runner.id, runner: { description: new_desc } post :update, id: runner.id, runner: { description: new_desc }
end.to change { runner.ensure_runner_queue_value }
runner.reload runner.reload
expect(response).to have_http_status(302) expect(response).to have_http_status(302)
expect(runner.description).to eq(new_desc) expect(runner.description).to eq(new_desc)
expect(runner.ensure_runner_queue_value).not_to eq(old_tick)
end end
end end
...@@ -55,31 +55,31 @@ describe Admin::RunnersController do ...@@ -55,31 +55,31 @@ describe Admin::RunnersController do
describe '#resume' do describe '#resume' do
it 'marks the runner as active and ticks the queue' do it 'marks the runner as active and ticks the queue' do
old_tick = runner.ensure_runner_queue_value
runner.update(active: false) runner.update(active: false)
expect do
post :resume, id: runner.id post :resume, id: runner.id
end.to change { runner.ensure_runner_queue_value }
runner.reload runner.reload
expect(response).to have_http_status(302) expect(response).to have_http_status(302)
expect(runner.active).to eq(true) expect(runner.active).to eq(true)
expect(runner.ensure_runner_queue_value).not_to eq(old_tick)
end end
end end
describe '#pause' do describe '#pause' do
it 'marks the runner as inactive and ticks the queue' do it 'marks the runner as inactive and ticks the queue' do
old_tick = runner.ensure_runner_queue_value
runner.update(active: true) runner.update(active: true)
expect do
post :pause, id: runner.id post :pause, id: runner.id
end.to change { runner.ensure_runner_queue_value }
runner.reload runner.reload
expect(response).to have_http_status(302) expect(response).to have_http_status(302)
expect(runner.active).to eq(false) expect(runner.active).to eq(false)
expect(runner.ensure_runner_queue_value).not_to eq(old_tick)
end end
end end
end end
...@@ -21,16 +21,16 @@ describe Projects::RunnersController do ...@@ -21,16 +21,16 @@ describe Projects::RunnersController do
describe '#update' do describe '#update' do
it 'updates the runner and ticks the queue' do it 'updates the runner and ticks the queue' do
old_tick = runner.ensure_runner_queue_value
new_desc = runner.description.swapcase new_desc = runner.description.swapcase
expect do
post :update, params.merge(runner: { description: new_desc } ) post :update, params.merge(runner: { description: new_desc } )
end.to change { runner.ensure_runner_queue_value }
runner.reload runner.reload
expect(response).to have_http_status(302) expect(response).to have_http_status(302)
expect(runner.description).to eq(new_desc) expect(runner.description).to eq(new_desc)
expect(runner.ensure_runner_queue_value).not_to eq(old_tick)
end end
end end
...@@ -45,31 +45,31 @@ describe Projects::RunnersController do ...@@ -45,31 +45,31 @@ describe Projects::RunnersController do
describe '#resume' do describe '#resume' do
it 'marks the runner as active and ticks the queue' do it 'marks the runner as active and ticks the queue' do
old_tick = runner.ensure_runner_queue_value
runner.update(active: false) runner.update(active: false)
expect do
post :resume, params post :resume, params
end.to change { runner.ensure_runner_queue_value }
runner.reload runner.reload
expect(response).to have_http_status(302) expect(response).to have_http_status(302)
expect(runner.active).to eq(true) expect(runner.active).to eq(true)
expect(runner.ensure_runner_queue_value).not_to eq(old_tick)
end end
end end
describe '#pause' do describe '#pause' do
it 'marks the runner as inactive and ticks the queue' do it 'marks the runner as inactive and ticks the queue' do
old_tick = runner.ensure_runner_queue_value
runner.update(active: true) runner.update(active: true)
expect do
post :pause, params post :pause, params
end.to change { runner.ensure_runner_queue_value }
runner.reload runner.reload
expect(response).to have_http_status(302) expect(response).to have_http_status(302)
expect(runner.active).to eq(false) expect(runner.active).to eq(false)
expect(runner.ensure_runner_queue_value).not_to eq(old_tick)
end end
end end
end end
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