Commit 2d615c30 authored by James Lopez's avatar James Lopez

rebase and refactor user specs

parent 93044dec
...@@ -478,6 +478,7 @@ describe API::Users do ...@@ -478,6 +478,7 @@ describe API::Users do
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(user.reload.password_expires_at).to be <= Time.now expect(user.reload.password_expires_at).to be <= Time.now
expect(AuditEvent.count).to eq(1)
end end
it "updates user with organization" do it "updates user with organization" do
...@@ -488,6 +489,14 @@ describe API::Users do ...@@ -488,6 +489,14 @@ describe API::Users do
expect(user.reload.organization).to eq('GitLab') expect(user.reload.organization).to eq('GitLab')
end end
it 'updates user with a new email' do
put api("/users/#{user.id}", admin), email: 'new@email.com'
expect(response).to have_http_status(200)
expect(user.reload.notification_email).to eq('new@email.com')
expect(AuditEvent.count).to eq(1)
end
it 'updates user with avatar' do it 'updates user with avatar' do
put api("/users/#{user.id}", admin), { avatar: fixture_file_upload(Rails.root + 'spec/fixtures/banana_sample.gif', 'image/gif') } put api("/users/#{user.id}", admin), { avatar: fixture_file_upload(Rails.root + 'spec/fixtures/banana_sample.gif', 'image/gif') }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment