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

Fixed tests and a rubocop linter

parent 0af99433
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -10,13 +10,11 @@ class Projects::HooksController < Projects::ApplicationController
@hook = @project.hooks.new(hook_params)
@hook.save
 
if @hook.valid?
redirect_to namespace_project_settings_integrations_path(@project.namespace, @project)
else
unless @hook.valid?
@hooks = @project.hooks.select(&:persisted?)
flash[:alert] = @hook.errors.full_messages.join.html_safe
redirect_to namespace_project_settings_integrations_path(@project.namespace, @project)
end
redirect_to namespace_project_settings_integrations_path(@project.namespace, @project)
end
 
def test
Loading
Loading
Loading
Loading
@@ -262,8 +262,8 @@ describe "Internal Project Access", feature: true do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/hooks" do
subject { namespace_project_hooks_path(project.namespace, project) }
describe "GET /:project_path/settings/integrations" do
subject { namespace_project_settings_integrations_path(project.namespace, project) }
 
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:owner).of(project) }
Loading
Loading
Loading
Loading
@@ -234,8 +234,8 @@ describe "Private Project Access", feature: true do
it { is_expected.to be_denied_for(:visitor) }
end
 
describe "GET /:project_path/hooks" do
subject { namespace_project_hooks_path(project.namespace, project) }
describe "GET /:project_path/namespace/hooks" do
subject { namespace_project_settings_integrations_path(project.namespace, project) }
 
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:owner).of(project) }
Loading
Loading
Loading
Loading
@@ -400,8 +400,8 @@ describe "Public Project Access", feature: true do
it { is_expected.to be_allowed_for(:visitor) }
end
 
describe "GET /:project_path/hooks" do
subject { namespace_project_hooks_path(project.namespace, project) }
describe "GET /:project_path/settings/integrations" do
subject { namespace_project_settings_integrations_path(project.namespace, project) }
 
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:owner).of(project) }
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