Skip to content

Commit

Permalink
Services::Users::Update specs updated, added spec for testing if Oper…
Browse files Browse the repository at this point in the history
…ation record was created
  • Loading branch information
alex223125 committed Sep 14, 2022
1 parent 60307af commit 37c8e23
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions spec/services/users/update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
expected_result = true
expect(target_user.is_archived).to eql(expected_result)
end

it 'should create one Operation log record' do
operations = Operation.all

expected_result = 1
expected_action = "Update existing user"
expected_user = current_user.email

expect(operations.count).to eql(expected_result)
expect(operations.first.action).to eql(expected_action)
expect(operations.first.user).to eql(expected_user)
end
end

context 'when we change status to false' do
Expand All @@ -34,11 +46,8 @@
expect(target_user.is_archived).to eql(expected_result)
end
end


end


context 'when user tries to update himself' do

let(:current_user) { create(:user) }
Expand Down

0 comments on commit 37c8e23

Please sign in to comment.