Skip to content
Snippets Groups Projects
Commit 1ee4f986 authored by Jose Ivan Vargas Lopez's avatar Jose Ivan Vargas Lopez
Browse files

Fixed spinach feature tests for the services and hooks controllers

Added a test for the integrations controller
parent 9f0d7945
No related branches found
No related tags found
No related merge requests found
Loading
@@ -10,6 +10,6 @@
Loading
@@ -10,6 +10,6 @@
%span.append-right-10.inline %span.append-right-10.inline
SSL Verification: #{hook.enable_ssl_verification ? "enabled" : "disabled"} SSL Verification: #{hook.enable_ssl_verification ? "enabled" : "disabled"}
= link_to "Test", test_namespace_project_hook_path(@project.namespace, @project, hook), class: "btn btn-sm" = link_to "Test", test_namespace_project_hook_path(@project.namespace, @project, hook), class: "btn btn-sm"
= link_to namespace_project_hook_path(@project.namespace, @project, hook), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-transparent" do = link_to namespace_project_settings_integrations_path(@project.namespace, @project, hook), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-transparent" do
%span.sr-only Remove %span.sr-only Remove
= icon('trash') = icon('trash')
- page_title "Webhooks"
- context_title = @project ? 'project' : 'group' - context_title = @project ? 'project' : 'group'
   
.row.prepend-top-default .row.prepend-top-default
Loading
@@ -99,7 +98,7 @@
Loading
@@ -99,7 +98,7 @@
- if hooks.any? - if hooks.any?
%ul.well-list %ul.well-list
- hooks.each do |hook| - hooks.each do |hook|
= render "project_hook", hook: hook = render "projects/hooks/project_hook", hook: hook
- else - else
%p.settings-message.text-center.append-bottom-0 %p.settings-message.text-center.append-bottom-0
No webhooks found, add one in the form above. No webhooks found, add one in the form above.
Loading
@@ -36,12 +36,12 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
Loading
@@ -36,12 +36,12 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
end end
   
step 'I should see newly created hook' do step 'I should see newly created hook' do
expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project) expect(current_path).to eq namespace_project_settings_integrations_path(current_project.namespace, current_project)
expect(page).to have_content(@url) expect(page).to have_content(@url)
end end
   
step 'I should see newly created hook with SSL verification enabled' do 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(current_path).to eq namespace_project_settings_integrations_path(current_project.namespace, current_project)
expect(page).to have_content(@url) expect(page).to have_content(@url)
expect(page).to have_content("SSL Verification: enabled") expect(page).to have_content("SSL Verification: enabled")
end end
Loading
@@ -57,7 +57,7 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
Loading
@@ -57,7 +57,7 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
end end
   
step 'hook should be triggered' do step 'hook should be triggered' do
expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project) expect(current_path).to eq namespace_project_settings_integrations_path(current_project.namespace, current_project)
expect(page).to have_selector '.flash-notice', expect(page).to have_selector '.flash-notice',
text: 'Hook executed successfully: HTTP 200' text: 'Hook executed successfully: HTTP 200'
end end
Loading
Loading
Loading
@@ -4,7 +4,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
Loading
@@ -4,7 +4,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
include SharedPaths include SharedPaths
   
step 'I visit project "Shop" services page' do step 'I visit project "Shop" services page' do
visit namespace_project_services_path(@project.namespace, @project) visit namespace_project_settings_integrations_path(@project.namespace, @project)
end end
   
step 'I should see list of available services' do step 'I should see list of available services' do
Loading
Loading
Loading
@@ -256,7 +256,7 @@ module SharedPaths
Loading
@@ -256,7 +256,7 @@ module SharedPaths
end end
   
step 'I visit project hooks page' do step 'I visit project hooks page' do
visit namespace_project_hooks_path(@project.namespace, @project) visit namespace_project_settings_integrations_path(@project.namespace, @project)
end end
   
step 'I visit project deploy keys page' do step 'I visit project deploy keys page' do
Loading
Loading
require ('spec_helper')
describe Projects::Settings::IntegrationsController do
let(:project) { create(:project, :public) }
let(:user) { create(:user) }
before do
project.team << [user, :master]
sign_in(user)
end
describe 'GET show' do
it 'renders show with 200 status code' do
get :show, namespace_id: project.namespace, project_id: project
expect(response).to have_http_status(200)
expect(response).to render_template(:show)
end
end
end
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