summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-26 16:06:02 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-26 16:06:02 +0000
commitef0149dd4440e1ea6d164f096112a5004a10ccf6 (patch)
tree7b44a7789fb9bdc21a5fd3560b9ff22a0b3fd57d /features
parent5b93c5579fabec5d7bcaf77128608ff2b9deecc5 (diff)
parentbafffb2d14e1924154d5b7c74c7b3cbcf8c898fd (diff)
downloadgitlab-ce-ef0149dd4440e1ea6d164f096112a5004a10ccf6.tar.gz
Merge branch 'enable_ssl_verification_web_hook' into 'master'
Enable SSL verification for Webhooks https://dev.gitlab.org/gitlab/gitlabhq/issues/2121 See merge request !1135
Diffstat (limited to 'features')
-rw-r--r--features/admin/hooks.feature9
-rw-r--r--features/project/hooks.feature5
-rw-r--r--features/steps/admin/hooks.rb15
-rw-r--r--features/steps/project/hooks.rb13
4 files changed, 42 insertions, 0 deletions
diff --git a/features/admin/hooks.feature b/features/admin/hooks.feature
new file mode 100644
index 00000000000..5ca332d9f1c
--- /dev/null
+++ b/features/admin/hooks.feature
@@ -0,0 +1,9 @@
+@admin
+Feature: Admin Hooks
+ Background:
+ Given I sign in as an admin
+
+ Scenario: On Admin Hooks
+ Given I visit admin hooks page
+ Then I submit the form with enabled SSL verification
+ And I see new hook with enabled SSL verification \ No newline at end of file
diff --git a/features/project/hooks.feature b/features/project/hooks.feature
index 1a60846a23e..627738004c4 100644
--- a/features/project/hooks.feature
+++ b/features/project/hooks.feature
@@ -13,6 +13,11 @@ Feature: Project Hooks
When I submit new hook
Then I should see newly created hook
+ Scenario: I add new hook with SSL verification enabled
+ Given I visit project hooks page
+ When I submit new hook with SSL verification enabled
+ Then I should see newly created hook with SSL verification enabled
+
Scenario: I test hook
Given project has hook
And I visit project hooks page
diff --git a/features/steps/admin/hooks.rb b/features/steps/admin/hooks.rb
new file mode 100644
index 00000000000..541e25fcb70
--- /dev/null
+++ b/features/steps/admin/hooks.rb
@@ -0,0 +1,15 @@
+class Spinach::Features::AdminHooks < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedAdmin
+
+ step "I submit the form with enabled SSL verification" do
+ fill_in 'hook_url', with: 'http://google.com'
+ check "Enable SSL verification"
+ click_on "Add System Hook"
+ end
+
+ step "I see new hook with enabled SSL verification" do
+ expect(page).to have_content "SSL Verification: enabled"
+ end
+end
diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb
index 04e3bf78ede..df4a23a3716 100644
--- a/features/steps/project/hooks.rb
+++ b/features/steps/project/hooks.rb
@@ -28,11 +28,24 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1)
end
+ step 'I submit new hook with SSL verification enabled' do
+ @url = FFaker::Internet.uri("http")
+ fill_in "hook_url", with: @url
+ check "hook_enable_ssl_verification"
+ expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1)
+ end
+
step 'I should see newly created hook' do
expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project)
expect(page).to have_content(@url)
end
+ step 'I should see newly created hook with SSL verification enabled' do
+ expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project)
+ expect(page).to have_content(@url)
+ expect(page).to have_content("SSL Verification: enabled")
+ end
+
step 'I click test hook button' do
stub_request(:post, @hook.url).to_return(status: 200)
click_link 'Test Hook'