summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/api
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-08-07 17:06:31 +0200
committerRémy Coutable <remy@rymai.me>2018-08-28 16:33:14 +0200
commited9bb8afa9687f48e03123f795aab047e667c062 (patch)
tree6d7e5f419744167c78570a627899655076a9ae49 /qa/qa/specs/features/api
parent7cd3fbb66f5b289f16cb6ba619fe6372285d316e (diff)
downloadgitlab-ce-ed9bb8afa9687f48e03123f795aab047e667c062.tar.gz
Improve QA scenarios contexts & descriptions consistency
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'qa/qa/specs/features/api')
-rw-r--r--qa/qa/specs/features/api/1_manage/users_spec.rb26
1 files changed, 10 insertions, 16 deletions
diff --git a/qa/qa/specs/features/api/1_manage/users_spec.rb b/qa/qa/specs/features/api/1_manage/users_spec.rb
index 3d25cca1e59..3e3c9e859aa 100644
--- a/qa/qa/specs/features/api/1_manage/users_spec.rb
+++ b/qa/qa/specs/features/api/1_manage/users_spec.rb
@@ -1,19 +1,21 @@
+# frozen_string_literal: true
+
module QA
- describe 'API users' do
- before(:context) do
- @api_client = Runtime::API::Client.new(:gitlab)
- end
+ context :manage do
+ describe 'Users API' do
+ before(:context) do
+ @api_client = Runtime::API::Client.new(:gitlab)
+ end
- context 'when authenticated' do
let(:request) { Runtime::API::Request.new(@api_client, '/users') }
- it 'get list of users' do
+ it 'GET /users' do
get request.url
expect_status(200)
end
- it 'submit request with a valid user name' do
+ it 'GET /users/:username with a valid username' do
get request.url, { params: { username: Runtime::User.username } }
expect_status(200)
@@ -22,20 +24,12 @@ module QA
)
end
- it 'submit request with an invalid user name' do
+ it 'GET /users/:username with an invalid username' do
get request.url, { params: { username: SecureRandom.hex(10) } }
expect_status(200)
expect(json_body).to eq([])
end
end
-
- it 'submit request with an invalid token' do
- request = Runtime::API::Request.new(@api_client, '/users', private_token: 'invalid')
-
- get request.url
-
- expect_status(401)
- end
end
end