diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-11-06 21:44:57 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-11-06 21:44:57 +0800 |
commit | fc6aad0b4442c58fde1ac924cb2dd73823273537 (patch) | |
tree | 3f4a46a5b649cf623ab5e8e42eaa2e06cb2b20cf /spec/requests/api/features_spec.rb | |
parent | 239332eed3fa870fd41be83864882c0f389840d8 (diff) | |
parent | cfc932cad10b1d6c494222e9d91aa75583b56145 (diff) | |
download | gitlab-ce-fc6aad0b4442c58fde1ac924cb2dd73823273537.tar.gz |
Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (1723 commits)
Resolve "Editor icons"
Refactor issuable destroy action
Ignore routes matching legacy_*_redirect in route specs
Gitlab::Git::RevList and LfsChanges use lazy popen
Gitlab::Git::Popen can lazily hand output to a block
Merge branch 'master-i18n' into 'master'
Remove unique validation from external_url in Environment
Expose `duration` in Job API entity
Add TimeCop freeze for DST and Regular time
Harcode project visibility
update a changelog
Put a condition to old migration that adds fast_forward column to MRs
Expose project visibility as CI variable
fix flaky tests by removing unneeded clicks and focus actions
fix flaky test in gfm_autocomplete_spec.rb
Use Gitlab::Git operations for repository mirroring
Encapsulate git operations for mirroring in Gitlab::Git
Create a Wiki Repository's raw_repository properly
Add `Gitlab::Git::Repository#fetch` command
Fix Gitlab::Metrics::System#real_time and #monotonic_time doc
...
Diffstat (limited to 'spec/requests/api/features_spec.rb')
-rw-r--r-- | spec/requests/api/features_spec.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/requests/api/features_spec.rb b/spec/requests/api/features_spec.rb index 7e21006b254..267058d98ee 100644 --- a/spec/requests/api/features_spec.rb +++ b/spec/requests/api/features_spec.rb @@ -44,19 +44,19 @@ describe API::Features do it 'returns a 401 for anonymous users' do get api('/features') - expect(response).to have_http_status(401) + expect(response).to have_gitlab_http_status(401) end it 'returns a 403 for users' do get api('/features', user) - expect(response).to have_http_status(403) + expect(response).to have_gitlab_http_status(403) end it 'returns the feature list for admins' do get api('/features', admin) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(json_response).to match_array(expected_features) end end @@ -68,20 +68,20 @@ describe API::Features do it 'returns a 401 for anonymous users' do post api("/features/#{feature_name}") - expect(response).to have_http_status(401) + expect(response).to have_gitlab_http_status(401) end it 'returns a 403 for users' do post api("/features/#{feature_name}", user) - expect(response).to have_http_status(403) + expect(response).to have_gitlab_http_status(403) end context 'when passed value=true' do it 'creates an enabled feature' do post api("/features/#{feature_name}", admin), value: 'true' - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response).to eq( 'name' => 'my_feature', 'state' => 'on', @@ -91,7 +91,7 @@ describe API::Features do 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' - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response).to eq( 'name' => 'my_feature', 'state' => 'conditional', @@ -104,7 +104,7 @@ describe API::Features do 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 - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response).to eq( 'name' => 'my_feature', 'state' => 'conditional', @@ -117,7 +117,7 @@ describe API::Features do 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' - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response).to eq( 'name' => 'my_feature', 'state' => 'conditional', @@ -132,7 +132,7 @@ describe API::Features do it 'creates a feature with the given percentage if passed an integer' do post api("/features/#{feature_name}", admin), value: '50' - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response).to eq( 'name' => 'my_feature', 'state' => 'conditional', @@ -154,7 +154,7 @@ describe API::Features do it 'enables the feature' do post api("/features/#{feature_name}", admin), value: 'true' - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response).to eq( 'name' => 'my_feature', 'state' => 'on', @@ -164,7 +164,7 @@ describe API::Features do 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' - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response).to eq( 'name' => 'my_feature', 'state' => 'conditional', @@ -177,7 +177,7 @@ describe API::Features do it 'enables the feature for the given user when passed user=username' do post api("/features/#{feature_name}", admin), value: 'true', user: user.username - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response).to eq( 'name' => 'my_feature', 'state' => 'conditional', @@ -195,7 +195,7 @@ describe API::Features do post api("/features/#{feature_name}", admin), value: 'false' - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response).to eq( 'name' => 'my_feature', 'state' => 'off', @@ -208,7 +208,7 @@ describe API::Features do post api("/features/#{feature_name}", admin), value: 'false', feature_group: 'perf_team' - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response).to eq( 'name' => 'my_feature', 'state' => 'off', @@ -221,7 +221,7 @@ describe API::Features do post api("/features/#{feature_name}", admin), value: 'false', user: user.username - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response).to eq( 'name' => 'my_feature', 'state' => 'off', @@ -237,7 +237,7 @@ describe API::Features do it 'updates the percentage of time if passed an integer' do post api("/features/#{feature_name}", admin), value: '30' - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response).to eq( 'name' => 'my_feature', 'state' => 'conditional', |