Commit 0b4338007593a984bde00672c63b6b1d4d26aa1a
1 parent
e7dfbe7a
Exists in
master
fix put archiving bug
Showing
2 changed files
with
24 additions
and
1 deletions
Show diff stats
app/controllers/scim_rails/scim_users_controller.rb
spec/controllers/scim_rails/scim_users_controller_spec.rb
... | ... | @@ -419,6 +419,27 @@ RSpec.describe ScimRails::ScimUsersController, type: :controller do |
419 | 419 | expect(response.status).to eq 200 |
420 | 420 | end |
421 | 421 | |
422 | + it "archives an inactive record" do | |
423 | + request.content_type = "application/scim+json" | |
424 | + put :put_update, params: { | |
425 | + id: 1, | |
426 | + userName: "test@example.com", | |
427 | + name: { | |
428 | + givenName: "Test", | |
429 | + familyName: "User" | |
430 | + }, | |
431 | + emails: [ | |
432 | + { | |
433 | + value: "test@example.com" | |
434 | + }, | |
435 | + ], | |
436 | + active: false | |
437 | + } | |
438 | + | |
439 | + expect(response.status).to eq 200 | |
440 | + expect(user.reload.active?).to eq false | |
441 | + end | |
442 | + | |
422 | 443 | it "returns :not_found for id that cannot be found" do |
423 | 444 | get :put_update, params: { id: "fake_id" } |
424 | 445 | ... | ... |