#369: updated autocompletes_controller_spec, groups/members_controller_spec, projects/hooks_controller_spec

This commit is contained in:
Vokhmin Alexey V 2014-11-25 00:29:21 +03:00
parent 4f3c9a8f3f
commit b26f32b5c2
3 changed files with 8 additions and 8 deletions

View File

@ -9,8 +9,8 @@ describe AutocompletesController do
set_session_for user set_session_for user
end end
it 'should be able to perform autocomplete_group_uname action' do it 'should be able to perform autocomplete_user_or_group action' do
get :autocomplete_group_uname get :autocomplete_user_or_group
response.should be_success response.should be_success
end end
@ -66,7 +66,7 @@ describe AutocompletesController do
end end
[ [
:autocomplete_group_uname, :autocomplete_user_or_group,
:autocomplete_user_uname, :autocomplete_user_uname,
:autocomplete_extra_build_list, :autocomplete_extra_build_list,
:autocomplete_extra_repositories :autocomplete_extra_repositories

View File

@ -7,9 +7,9 @@ describe Groups::MembersController do
@user = @group.owner @user = @group.owner
set_session_for @user set_session_for @user
@another_user = FactoryGirl.create(:user) @another_user = FactoryGirl.create(:user)
@add_params = {group_id: @group, user_uname: @another_user.uname} @add_params = {group_id: @group, member_id: @another_user.id}
@remove_params = {group_id: @group, user_remove: {"#{@group.owner.id}"=>["1"]}} @remove_params = {group_id: @group, members: [@group.owner.id]}
@update_params = {group_id: @group, user: {"#{@group.owner.id}"=>'reader'}} @update_params = {group_id: @group, member_id: @group.owner.id, role: :reader}
end end
context 'for owner user' do context 'for owner user' do
@ -61,7 +61,7 @@ describe Groups::MembersController do
it 'should not set read role to owner group' do it 'should not set read role to owner group' do
post :update, @update_params post :update, @update_params
Relation.by_target(@group).by_actor(@user).first.role.should eql('admin') Relation.by_target(@group).by_actor(@user).first.role.should eql('admin')
response.should redirect_to(group_members_path(@group)) response.should redirect_to(forbidden_path)
end end
end end

View File

@ -120,7 +120,7 @@ describe Projects::HooksController do
end end
context 'group member user with reader role' do context 'group member user with reader role' do
before { create_actor_relation(@group, @auser, 'reader') } before { create_actor_relation(@group, @user, 'reader') }
it_should_behave_like 'hooks user without project admin rights' it_should_behave_like 'hooks user without project admin rights'