mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-19 01:26:08 +10:00
Merge pull request #8831 from bladealslayer/fix/api-user-tests
Fix user API tests succeeding for the wrong reason
This commit is contained in:
@@ -110,17 +110,22 @@ describe API::API, api: true do
|
||||
end
|
||||
|
||||
it 'should return 400 error if name not given' do
|
||||
post api('/users', admin), email: 'test@example.com', password: 'pass1234'
|
||||
post api('/users', admin), attributes_for(:user).except(:name)
|
||||
expect(response.status).to eq(400)
|
||||
end
|
||||
|
||||
it 'should return 400 error if password not given' do
|
||||
post api('/users', admin), email: 'test@example.com', name: 'test'
|
||||
post api('/users', admin), attributes_for(:user).except(:password)
|
||||
expect(response.status).to eq(400)
|
||||
end
|
||||
|
||||
it "should return 400 error if email not given" do
|
||||
post api('/users', admin), password: 'pass1234', name: 'test'
|
||||
it 'should return 400 error if email not given' do
|
||||
post api('/users', admin), attributes_for(:user).except(:email)
|
||||
expect(response.status).to eq(400)
|
||||
end
|
||||
|
||||
it 'should return 400 error if username not given' do
|
||||
post api('/users', admin), attributes_for(:user).except(:username)
|
||||
expect(response.status).to eq(400)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user