summaryrefslogtreecommitdiff
path: root/spec/requests/api/features_spec.rb
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2018-12-18 09:52:17 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2018-12-19 10:04:31 +1100
commitb44a2c801a64fb282cea794871fcfcf81e4ec539 (patch)
tree32e699b6efa548048abe11f29f84e85e3d2a034f /spec/requests/api/features_spec.rb
parent5d68c23792e87e710877e4baf57605bcf11a6cb5 (diff)
downloadgitlab-ce-b44a2c801a64fb282cea794871fcfcf81e4ec539.tar.gz
Update specs to rails5 formatblackst0ne-convert-specs-rails5-style
Updates specs to use new rails5 format. The old format: `get :show, { some: params }, { some: headers }` The new format: `get :show, params: { some: params }, headers: { some: headers }`
Diffstat (limited to 'spec/requests/api/features_spec.rb')
-rw-r--r--spec/requests/api/features_spec.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/requests/api/features_spec.rb b/spec/requests/api/features_spec.rb
index c5354c2d639..7d3eff7d32d 100644
--- a/spec/requests/api/features_spec.rb
+++ b/spec/requests/api/features_spec.rb
@@ -79,7 +79,7 @@ describe API::Features do
context 'when passed value=true' do
it 'creates an enabled feature' do
- post api("/features/#{feature_name}", admin), value: 'true'
+ post api("/features/#{feature_name}", admin), params: { value: 'true' }
expect(response).to have_gitlab_http_status(201)
expect(json_response).to eq(
@@ -89,7 +89,7 @@ describe API::Features do
end
it 'creates an enabled feature for the given Flipper group when passed feature_group=perf_team' do
- post api("/features/#{feature_name}", admin), value: 'true', feature_group: 'perf_team'
+ post api("/features/#{feature_name}", admin), params: { value: 'true', feature_group: 'perf_team' }
expect(response).to have_gitlab_http_status(201)
expect(json_response).to eq(
@@ -102,7 +102,7 @@ describe API::Features do
end
it 'creates an enabled feature for the given user when passed user=username' do
- post api("/features/#{feature_name}", admin), value: 'true', user: user.username
+ post api("/features/#{feature_name}", admin), params: { value: 'true', user: user.username }
expect(response).to have_gitlab_http_status(201)
expect(json_response).to eq(
@@ -115,7 +115,7 @@ describe API::Features do
end
it 'creates an enabled feature for the given user and feature group when passed user=username and feature_group=perf_team' do
- post api("/features/#{feature_name}", admin), value: 'true', user: user.username, feature_group: 'perf_team'
+ post api("/features/#{feature_name}", admin), params: { value: 'true', user: user.username, feature_group: 'perf_team' }
expect(response).to have_gitlab_http_status(201)
expect(json_response).to eq(
@@ -130,7 +130,7 @@ describe API::Features do
end
it 'creates a feature with the given percentage if passed an integer' do
- post api("/features/#{feature_name}", admin), value: '50'
+ post api("/features/#{feature_name}", admin), params: { value: '50' }
expect(response).to have_gitlab_http_status(201)
expect(json_response).to eq(
@@ -152,7 +152,7 @@ describe API::Features do
context 'when passed value=true' do
it 'enables the feature' do
- post api("/features/#{feature_name}", admin), value: 'true'
+ post api("/features/#{feature_name}", admin), params: { value: 'true' }
expect(response).to have_gitlab_http_status(201)
expect(json_response).to eq(
@@ -162,7 +162,7 @@ describe API::Features do
end
it 'enables the feature for the given Flipper group when passed feature_group=perf_team' do
- post api("/features/#{feature_name}", admin), value: 'true', feature_group: 'perf_team'
+ post api("/features/#{feature_name}", admin), params: { value: 'true', feature_group: 'perf_team' }
expect(response).to have_gitlab_http_status(201)
expect(json_response).to eq(
@@ -175,7 +175,7 @@ describe API::Features do
end
it 'enables the feature for the given user when passed user=username' do
- post api("/features/#{feature_name}", admin), value: 'true', user: user.username
+ post api("/features/#{feature_name}", admin), params: { value: 'true', user: user.username }
expect(response).to have_gitlab_http_status(201)
expect(json_response).to eq(
@@ -193,7 +193,7 @@ describe API::Features do
feature.enable
expect(feature).to be_enabled
- post api("/features/#{feature_name}", admin), value: 'false'
+ post api("/features/#{feature_name}", admin), params: { value: 'false' }
expect(response).to have_gitlab_http_status(201)
expect(json_response).to eq(
@@ -206,7 +206,7 @@ describe API::Features do
feature.enable(Feature.group(:perf_team))
expect(Feature.get(feature_name).enabled?(admin)).to be_truthy
- post api("/features/#{feature_name}", admin), value: 'false', feature_group: 'perf_team'
+ post api("/features/#{feature_name}", admin), params: { value: 'false', feature_group: 'perf_team' }
expect(response).to have_gitlab_http_status(201)
expect(json_response).to eq(
@@ -219,7 +219,7 @@ describe API::Features do
feature.enable(user)
expect(Feature.get(feature_name).enabled?(user)).to be_truthy
- post api("/features/#{feature_name}", admin), value: 'false', user: user.username
+ post api("/features/#{feature_name}", admin), params: { value: 'false', user: user.username }
expect(response).to have_gitlab_http_status(201)
expect(json_response).to eq(
@@ -235,7 +235,7 @@ describe API::Features do
end
it 'updates the percentage of time if passed an integer' do
- post api("/features/#{feature_name}", admin), value: '30'
+ post api("/features/#{feature_name}", admin), params: { value: '30' }
expect(response).to have_gitlab_http_status(201)
expect(json_response).to eq(