blob: 53587209bfb27f37d89231488d9f5b24b33e6814 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# frozen_string_literal: true
require 'airborne'
module QA
RSpec.describe 'Manage' do
describe 'Users API' do
let(:api_client) { Runtime::API::Client.new(:gitlab) }
let(:request) { Runtime::API::Request.new(api_client, '/users') }
it 'GET /users', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347882' do
get request.url
expect_status(200)
end
it 'GET /users/:username with a valid username', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347886' do
get request.url, { params: { username: Runtime::User.username } }
expect_status(200)
expect(json_body).to contain_exactly(
a_hash_including(username: Runtime::User.username)
)
end
it 'GET /users/:username with an invalid username', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347883' do
get request.url, { params: { username: SecureRandom.hex(10) } }
expect_status(200)
expect(json_body).to eq([])
end
end
end
end
|