diff options
author | Rémy Coutable <remy@rymai.me> | 2016-12-07 11:47:30 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-12-07 11:47:30 +0000 |
commit | 911c1601f81d8e0050766b533beaaf4e612c5592 (patch) | |
tree | 3a5747b7c4ff05ce374e8045298cdd76a2094c64 | |
parent | 0fc1e9a8e00926ba2c65f38a68ffd4e21c5844ba (diff) | |
parent | d33b22f23890f5d67f1e88a41efc4d8adec6611c (diff) | |
download | gitlab-ce-911c1601f81d8e0050766b533beaaf4e612c5592.tar.gz |
Merge branch 'move-admin-hooks-spinach-test-to-rspec' into 'master'
Move admin hooks spinach to RSpec
https://gitlab.com/gitlab-org/gitlab-ce/issues/23036
See merge request !7942
-rw-r--r-- | changelogs/unreleased/move-admin-hooks-spinach-test-to-rspec.yml | 4 | ||||
-rw-r--r-- | features/admin/hooks.feature | 9 | ||||
-rw-r--r-- | features/steps/admin/hooks.rb | 15 | ||||
-rw-r--r-- | spec/features/admin/admin_hooks_spec.rb | 15 |
4 files changed, 12 insertions, 31 deletions
diff --git a/changelogs/unreleased/move-admin-hooks-spinach-test-to-rspec.yml b/changelogs/unreleased/move-admin-hooks-spinach-test-to-rspec.yml new file mode 100644 index 00000000000..7dfd741985a --- /dev/null +++ b/changelogs/unreleased/move-admin-hooks-spinach-test-to-rspec.yml @@ -0,0 +1,4 @@ +--- +title: Move admin hooks spinach to rspec +merge_request: 7942 +author: Semyon Pupkov diff --git a/features/admin/hooks.feature b/features/admin/hooks.feature deleted file mode 100644 index 5ca332d9f1c..00000000000 --- a/features/admin/hooks.feature +++ /dev/null @@ -1,9 +0,0 @@ -@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/steps/admin/hooks.rb b/features/steps/admin/hooks.rb deleted file mode 100644 index 541e25fcb70..00000000000 --- a/features/steps/admin/hooks.rb +++ /dev/null @@ -1,15 +0,0 @@ -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/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb index b3ce72b1452..f246997d5a2 100644 --- a/spec/features/admin/admin_hooks_spec.rb +++ b/spec/features/admin/admin_hooks_spec.rb @@ -26,16 +26,17 @@ describe "Admin::Hooks", feature: true do end describe "New Hook" do - before do - @url = FFaker::Internet.uri("http") + let(:url) { FFaker::Internet.uri('http') } + + it 'adds new hook' do visit admin_hooks_path - fill_in "hook_url", with: @url - expect { click_button "Add System Hook" }.to change(SystemHook, :count).by(1) - end + fill_in 'hook_url', with: url + check 'Enable SSL verification' - it "opens new hook popup" do + expect { click_button 'Add System Hook' }.to change(SystemHook, :count).by(1) + expect(page).to have_content 'SSL Verification: enabled' expect(current_path).to eq(admin_hooks_path) - expect(page).to have_content(@url) + expect(page).to have_content(url) end end |