From 19b56818a08c22f0c90c268ce88256763f81f211 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Wed, 19 Mar 2014 02:12:03 +0400 Subject: [PATCH] #345: updated hooks_controller_spec --- .../projects/hooks_controller_spec.rb | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/controllers/projects/hooks_controller_spec.rb b/spec/controllers/projects/hooks_controller_spec.rb index 27608d625..f9d3132e5 100644 --- a/spec/controllers/projects/hooks_controller_spec.rb +++ b/spec/controllers/projects/hooks_controller_spec.rb @@ -2,54 +2,54 @@ require 'spec_helper' shared_examples_for 'hooks user with project admin rights' do it 'should be able to perform index action' do - get :index, {owner_name: @project.owner.uname, project_name: @project.name} + get :index, {owner_with_name: "#{@project.owner.uname}/#{@project.name}"} response.should be_success end it 'should be able to perform new action' do - get :new, {owner_name: @project.owner.uname, project_name: @project.name, hook: {name: 'web'}} + get :new, {owner_with_name: "#{@project.owner.uname}/#{@project.name}", hook: {name: 'web'}} response.should be_success end it 'should be able to perform edit action' do - get :new, {owner_name: @project.owner.uname, project_name: @project.name, id: @hook.id} + get :new, {owner_with_name: "#{@project.owner.uname}/#{@project.name}", id: @hook.id} response.should be_success end it 'should be able to perform update action' do - put :update, {owner_name: @project.owner.uname, project_name: @project.name, id: @hook.id}.merge(@update_params) + put :update, {owner_with_name: "#{@project.owner.uname}/#{@project.name}", id: @hook.id}.merge(@update_params) response.should redirect_to(project_hooks_path(@project, name: 'web')) end it 'should be able to perform create action' do - post :create, {owner_name: @project.owner.uname, project_name: @project.name}.merge(@create_params) + post :create, {owner_with_name: "#{@project.owner.uname}/#{@project.name}"}.merge(@create_params) response.should redirect_to(project_hooks_path(@project, name: 'web')) end end shared_examples_for 'hooks user without project admin rights' do it 'should not be able to perform index action' do - get :index, {owner_name: @project.owner.uname, project_name: @project.name} + get :index, {owner_with_name: "#{@project.owner.uname}/#{@project.name}"} response.should redirect_to(forbidden_path) end it 'should not be able to perform new action' do - get :new, {owner_name: @project.owner.uname, project_name: @project.name, hook: {name: 'web'}} + get :new, {owner_with_name: "#{@project.owner.uname}/#{@project.name}", hook: {name: 'web'}} response.should redirect_to(forbidden_path) end it 'should not be able to perform edit action' do - get :new, {owner_name: @project.owner.uname, project_name: @project.name, id: @hook.id} + get :new, {owner_with_name: "#{@project.owner.uname}/#{@project.name}", id: @hook.id} response.should redirect_to(forbidden_path) end it 'should not be able to perform update action' do - put :update, {owner_name: @project.owner.uname, project_name: @project.name, id: @hook.id}.merge(@update_params) + put :update, {owner_with_name: "#{@project.owner.uname}/#{@project.name}", id: @hook.id}.merge(@update_params) response.should redirect_to(forbidden_path) end it 'should not be able to perform create action' do - post :create, {owner_name: @project.owner.uname, project_name: @project.name}.merge(@create_params) + post :create, {owner_with_name: "#{@project.owner.uname}/#{@project.name}"}.merge(@create_params) response.should redirect_to(forbidden_path) end end