summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorLukas Erlacher <erlacher@in.tum.de>2014-08-18 16:46:46 +0200
committerLukas Erlacher <erlacher@in.tum.de>2014-09-03 01:27:02 +0200
commit40fc4261f2e6c8eaf6e885405863e929ecbd47b3 (patch)
tree236e7f674a1983e19a74507fc9d9b54021073caa /spec/services
parent00ccaed029efbbdff96a4b64628a3a2d9bf5125d (diff)
downloadgitlab-ce-40fc4261f2e6c8eaf6e885405863e929ecbd47b3.tar.gz
Add system hook for ssh key changes
Add system hook for ssh key create and destroy Update and fix documentation Update tests
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/system_hooks_service_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/services/system_hooks_service_spec.rb b/spec/services/system_hooks_service_spec.rb
index 3c2eec6cfd9..7497bdb0b3c 100644
--- a/spec/services/system_hooks_service_spec.rb
+++ b/spec/services/system_hooks_service_spec.rb
@@ -4,6 +4,7 @@ describe SystemHooksService do
let (:user) { create :user }
let (:project) { create :project }
let (:users_project) { create :users_project }
+ let (:key) { create(:key, user: user) }
context 'event data' do
it { event_data(user, :create).should include(:event_name, :name, :created_at, :email, :user_id) }
@@ -12,6 +13,8 @@ describe SystemHooksService do
it { event_data(project, :destroy).should include(:event_name, :name, :created_at, :path, :project_id, :owner_name, :owner_email, :project_visibility) }
it { event_data(users_project, :create).should include(:event_name, :created_at, :project_name, :project_path, :project_id, :user_name, :user_email, :project_access, :project_visibility) }
it { event_data(users_project, :destroy).should include(:event_name, :created_at, :project_name, :project_path, :project_id, :user_name, :user_email, :project_access, :project_visibility) }
+ it { event_data(key, :create).should include(:username, :key, :id) }
+ it { event_data(key, :destroy).should include(:username, :key, :id) }
end
context 'event names' do
@@ -21,6 +24,8 @@ describe SystemHooksService do
it { event_name(project, :destroy).should eq "project_destroy" }
it { event_name(users_project, :create).should eq "user_add_to_team" }
it { event_name(users_project, :destroy).should eq "user_remove_from_team" }
+ it { event_name(key, :create).should eq 'key_create' }
+ it { event_name(key, :destroy).should eq 'key_destroy' }
end
def event_data(*args)