Commit bf154b8a31714102cfdd201aa293737b99009e46
1 parent
1762c0da
Exists in
master
add to spec that user is updated from post when one exists
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
spec/controllers/scim_rails/scim_users_controller_spec.rb
... | ... | @@ -305,12 +305,12 @@ RSpec.describe ScimRails::ScimUsersController, type: :controller do |
305 | 305 | expect(company.users.count).to eq 0 |
306 | 306 | end |
307 | 307 | |
308 | - it "returns 201 if user already exists" do | |
308 | + it "returns 201 if user already exists and updates user" do | |
309 | 309 | create(:user, email: "new@example.com", company: company) |
310 | 310 | |
311 | 311 | post :create, params: { |
312 | 312 | name: { |
313 | - givenName: "New", | |
313 | + givenName: "Not New", | |
314 | 314 | familyName: "User" |
315 | 315 | }, |
316 | 316 | emails: [ |
... | ... | @@ -322,6 +322,7 @@ RSpec.describe ScimRails::ScimUsersController, type: :controller do |
322 | 322 | |
323 | 323 | expect(response.status).to eq 201 |
324 | 324 | expect(company.users.count).to eq 1 |
325 | + expect(company.users.first.first_name).to eq "Not New" | |
325 | 326 | end |
326 | 327 | |
327 | 328 | it "creates and archives inactive user" do | ... | ... |