diff options
author | Stan Hu <stanhu@gmail.com> | 2018-01-15 08:10:48 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-01-15 09:22:06 +0300 |
commit | 0d187a9a65c5a8eae4bcb09228270cb974abd466 (patch) | |
tree | 7a958c51641edb5c8606380d673587f35deeeb8f /spec/services/system_hooks_service_spec.rb | |
parent | 74f2f9b30fb1972a26481072486b358eb943309f (diff) |
Log and send a system hook if a blocked user fails to login
Closes #41633
Diffstat (limited to 'spec/services/system_hooks_service_spec.rb')
-rw-r--r-- | spec/services/system_hooks_service_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/services/system_hooks_service_spec.rb b/spec/services/system_hooks_service_spec.rb index 46cd10cdc12..c40cd5b7548 100644 --- a/spec/services/system_hooks_service_spec.rb +++ b/spec/services/system_hooks_service_spec.rb @@ -105,12 +105,25 @@ describe SystemHooksService do expect(data[:old_username]).to eq(user.username_was) end end + + context 'user_failed_login' do + it 'contains state of user' do + user.ldap_block! + + data = event_data(user, :failed_login) + + expect(data).to include(:event_name, :name, :created_at, :updated_at, :email, :user_id, :username, :state) + expect(data[:username]).to eq(user.username) + expect(data[:state]).to eq('ldap_blocked') + end + end end context 'event names' do it { expect(event_name(user, :create)).to eq "user_create" } it { expect(event_name(user, :destroy)).to eq "user_destroy" } it { expect(event_name(user, :rename)).to eq 'user_rename' } + it { expect(event_name(user, :failed_login)).to eq 'user_failed_login' } it { expect(event_name(project, :create)).to eq "project_create" } it { expect(event_name(project, :destroy)).to eq "project_destroy" } it { expect(event_name(project, :rename)).to eq "project_rename" } |