summaryrefslogtreecommitdiff
path: root/spec/requests/ci
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-05-19 21:27:52 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-05-19 22:01:53 +0200
commit4cc77c3bf8ef72d1b08160da9f55eb1c5f95e832 (patch)
treecb095884c8ff6e6ab71b3dfe8d018cccdb7e4611 /spec/requests/ci
parentc3c503d259bbf4691f0fb24fcd713ec5b4474e61 (diff)
downloadgitlab-ce-4cc77c3bf8ef72d1b08160da9f55eb1c5f95e832.tar.gz
Minor runner-related code refactorings
Diffstat (limited to 'spec/requests/ci')
-rw-r--r--spec/requests/ci/api/runners_spec.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/requests/ci/api/runners_spec.rb b/spec/requests/ci/api/runners_spec.rb
index eb11258cbbb..43596f07cb5 100644
--- a/spec/requests/ci/api/runners_spec.rb
+++ b/spec/requests/ci/api/runners_spec.rb
@@ -16,7 +16,7 @@ describe Ci::API::API do
before { post ci_api("/runners/register"), token: registration_token }
it 'creates runner with default values' do
- expect(response.status).to eq(201)
+ expect(response).to have_http_status 201
expect(Ci::Runner.first.run_untagged).to be true
end
end
@@ -28,7 +28,7 @@ describe Ci::API::API do
end
it 'creates runner' do
- expect(response.status).to eq(201)
+ expect(response).to have_http_status 201
expect(Ci::Runner.first.description).to eq("server.hostname")
end
end
@@ -40,7 +40,7 @@ describe Ci::API::API do
end
it 'creates runner' do
- expect(response.status).to eq(201)
+ expect(response).to have_http_status 201
expect(Ci::Runner.first.tag_list.sort).to eq(["tag1", "tag2"])
end
end
@@ -52,7 +52,7 @@ describe Ci::API::API do
run_untagged: false,
tag_list: ['tag']
- expect(response.status).to eq(201)
+ expect(response).to have_http_status 201
expect(Ci::Runner.first.run_untagged).to be false
end
end
@@ -62,7 +62,7 @@ describe Ci::API::API do
post ci_api("/runners/register"), token: registration_token,
run_untagged: false
- expect(response.status).to eq(404)
+ expect(response).to have_http_status 404
end
end
end
@@ -72,7 +72,7 @@ describe Ci::API::API do
before { post ci_api("/runners/register"), token: project.runners_token }
it 'creates runner' do
- expect(response.status).to eq(201)
+ expect(response).to have_http_status 201
expect(project.runners.size).to eq(1)
end
end
@@ -81,7 +81,7 @@ describe Ci::API::API do
it 'returns 403 error' do
post ci_api("/runners/register"), token: 'invalid'
- expect(response.status).to eq(403)
+ expect(response).to have_http_status 403
end
end
@@ -89,7 +89,7 @@ describe Ci::API::API do
it 'returns 400 error' do
post ci_api("/runners/register")
- expect(response.status).to eq(400)
+ expect(response).to have_http_status 400
end
end
@@ -101,7 +101,7 @@ describe Ci::API::API do
it do
post ci_api("/runners/register"), token: registration_token, info: { param => value }
- expect(response.status).to eq(201)
+ expect(response).to have_http_status 201
is_expected.to eq(value)
end
end
@@ -112,7 +112,7 @@ describe Ci::API::API do
let!(:runner) { FactoryGirl.create(:ci_runner) }
before { delete ci_api("/runners/delete"), token: runner.token }
- it { expect(response.status).to eq(200) }
+ it { expect(response).to have_http_status 200 }
it { expect(Ci::Runner.count).to eq(0) }
end
end