Skip to content
Snippets Groups Projects
Commit d33b22f2 authored by Semyon Pupkov's avatar Semyon Pupkov
Browse files

Move admin hooks spinach to rspec

parent 4e96c531
No related branches found
No related tags found
No related merge requests found
---
title: Move admin hooks spinach to rspec
merge_request: 7942
author: Semyon Pupkov
@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
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
Loading
Loading
@@ -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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment