diff options
author | Rémy Coutable <remy@rymai.me> | 2017-07-05 21:55:27 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-07-06 11:18:26 +0200 |
commit | e5a7d1da8cfda5dc3755b6a0a1ed450415f39873 (patch) | |
tree | 409af2c78ed74fa045562f92bc3c17a045519c72 /spec/requests/api/features_spec.rb | |
parent | 00ac76cc4ce87954d770abae411c54eb8bf23360 (diff) | |
download | gitlab-ce-e5a7d1da8cfda5dc3755b6a0a1ed450415f39873.tar.gz |
Improve Features API and its docs and add a Changelog item
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/requests/api/features_spec.rb')
-rw-r--r-- | spec/requests/api/features_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/requests/api/features_spec.rb b/spec/requests/api/features_spec.rb index 1d8aaeea8f2..7e21006b254 100644 --- a/spec/requests/api/features_spec.rb +++ b/spec/requests/api/features_spec.rb @@ -113,6 +113,20 @@ describe API::Features do { 'key' => 'actors', 'value' => ["User:#{user.id}"] } ]) 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' + + expect(response).to have_http_status(201) + expect(json_response).to eq( + 'name' => 'my_feature', + 'state' => 'conditional', + 'gates' => [ + { 'key' => 'boolean', 'value' => false }, + { 'key' => 'groups', 'value' => ['perf_team'] }, + { 'key' => 'actors', 'value' => ["User:#{user.id}"] } + ]) + end end it 'creates a feature with the given percentage if passed an integer' do |