Update projects_controller_spec

This commit is contained in:
Vokhmin Alexey V 2015-06-09 02:25:56 +03:00
parent 498f724986
commit 874a17c79b
1 changed files with 126 additions and 137 deletions

View File

@ -5,16 +5,16 @@ shared_examples_for "api projects user with reader rights" do
end end
shared_examples_for "api projects user with reader rights for hidden project" do shared_examples_for "api projects user with reader rights for hidden project" do
before(:each) do before do
@project.update_column(:visibility, 'hidden') project.update_column(:visibility, 'hidden')
end end
it_should_behave_like 'api projects user with show rights' it_should_behave_like 'api projects user with show rights'
end end
shared_examples_for "api projects user without reader rights for hidden project" do shared_examples_for "api projects user without reader rights for hidden project" do
before(:each) do before do
@project.update_column(:visibility, 'hidden') project.update_column(:visibility, 'hidden')
end end
it_should_behave_like 'api projects user without show rights' it_should_behave_like 'api projects user without show rights'
@ -22,98 +22,92 @@ end
shared_examples_for "api projects user without show rights" do shared_examples_for "api projects user without show rights" do
it "to show access violation instead of project data" do it "to show access violation instead of project data" do
get :show, id: @project.id, format: :json get :show, id: project.id, format: :json
expect(response).to_not be_success expect(response).to_not be_success
end end
it "to show access violation instead of project refs_list" do it "to show access violation instead of project refs_list" do
get :refs_list, id: @project.id, format: :json get :refs_list, id: project.id, format: :json
expect(response).to_not be_success expect(response).to_not be_success
end end
it "to access violation instead of project data by get_id" do it "to access violation instead of project data by get_id" do
get :get_id, name: @project.name, owner: @project.owner_uname, format: :json get :get_id, name: project.name, owner: project.owner_uname, format: :json
expect(response).to_not be_success expect(response).to_not be_success
end end
it "to show access violation instead of project members data" do it "to show access violation instead of project members data" do
get :members, id: @project.id, format: :json get :members, id: project.id, format: :json
expect(response).to_not be_success expect(response).to_not be_success
end end
end end
shared_examples_for 'api projects user without fork rights' do shared_examples_for 'api projects user without fork rights' do
before { project } # init
it 'to not be able to perform fork action' do it 'to not be able to perform fork action' do
post :fork, id: @project.id, format: :json
expect(response).to_not be_success
end
it 'ensures that project has not been forked' do
expect do expect do
post :fork, id: @project.id, format: :json post :fork, id: project.id, format: :json
end.to_not change(Project, :count) end.to_not change(Project, :count)
expect(response).to_not be_success
end end
end end
shared_examples_for 'api projects user with fork rights' do shared_examples_for 'api projects user with fork rights' do
before { project } # init
it 'to be able to perform fork action' do it 'to be able to perform fork action' do
post :fork, id: @project.id, format: :json
expect(response).to be_success
end
it 'ensures that project has been forked' do
expect do expect do
post :fork, id: @project.id, format: :json post :fork, id: project.id, format: :json
end.to change(Project, :count).by(1) end.to change(Project, :count).by(1)
expect(response).to be_success
end end
it 'to be able to perform fork action with different name' do it 'to be able to perform fork action with different name' do
post :fork, id: @project.id, fork_name: (@project.name + '_forked'), format: :json new_name = project.name + '_forked'
expect(response).to be_success
end
it 'ensures that project has been forked' do
new_name = @project.name + '_forked'
expect do expect do
post :fork, id: @project.id, fork_name: new_name, format: :json post :fork, id: project.id, fork_name: new_name, format: :json
end.to change{ Project.where(name: new_name).count }.by(1) end.to change{ Project.where(name: new_name).count }.by(1)
expect(response).to be_success
end end
end end
shared_examples_for 'api projects user with fork rights for hidden project' do shared_examples_for 'api projects user with fork rights for hidden project' do
before { @project.update_column(:visibility, 'hidden') } before { project.update_column(:visibility, 'hidden') }
it_should_behave_like 'api projects user with fork rights' it_should_behave_like 'api projects user with fork rights'
end end
shared_examples_for 'api projects user without fork rights for hidden project' do shared_examples_for 'api projects user without fork rights for hidden project' do
before { @project.update_column(:visibility, 'hidden') } before { project.update_column(:visibility, 'hidden') }
it_should_behave_like 'api projects user without fork rights' it_should_behave_like 'api projects user without fork rights'
end end
shared_examples_for "api projects user with show rights" do shared_examples_for "api projects user with show rights" do
it "to show project data" do it "to show project data" do
get :show, id: @project.id, format: :json get :show, id: project.id, format: :json
expect(response).to render_template(:show) expect(response).to render_template(:show)
end end
it "to show refs_list of project" do it "to show refs_list of project" do
get :refs_list, id: @project.id, format: :json get :refs_list, id: project.id, format: :json
expect(response).to render_template(:refs_list) expect(response).to render_template(:refs_list)
end end
context 'project find by get_id' do context 'project find by get_id' do
it "to find project by name and owner name" do it "to find project by name and owner name" do
@project.reload project.reload
get :get_id, name: @project.name, owner: @project.owner_uname, format: :json get :get_id, name: project.name, owner: project.owner_uname, format: :json
expect(assigns[:project].id).to eq @project.id expect(assigns[:project].id).to eq project.id
end end
it "to not find project by non existing name and owner name" do it "to not find project by non existing name and owner name" do
get :get_id, name: 'NONE_EXISTING_NAME', owner: @project.owner_uname, format: :json get :get_id, name: 'NONE_EXISTING_NAME', owner: project.owner_uname, format: :json
expect(assigns :project).to be_blank expect(assigns :project).to be_blank
end end
it "to render 404 for non existing name and owner name" do it "to render 404 for non existing name and owner name" do
get :get_id, name: 'NONE_EXISTING_NAME', owner: @project.owner_uname, format: :json get :get_id, name: 'NONE_EXISTING_NAME', owner: project.owner_uname, format: :json
expect(response.body).to eq({status: 404, message: I18n.t("flash.404_message")}.to_json) expect(response.body).to eq({status: 404, message: I18n.t("flash.404_message")}.to_json)
end end
end end
@ -122,68 +116,60 @@ end
shared_examples_for 'api projects user with admin rights' do shared_examples_for 'api projects user with admin rights' do
it "to be able to perform members action" do it "to be able to perform members action" do
get :members, id: @project.id, format: :json get :members, id: project.id, format: :json
expect(response).to be_success expect(response).to be_success
end end
it 'to not set a wrong maintainer_id' do it 'to not set a wrong maintainer_id' do
put :update, project: { maintainer_id: -1 }, id: @project.id, format: :json put :update, project: { maintainer_id: -1 }, id: project.id, format: :json
expect(response).to_not be_success expect(response).to_not be_success
end end
context 'api project user with update rights' do context 'api project user with update rights' do
before do before do
put :update, project: { description: 'new description' }, id: @project.id, format: :json put :update, project: { description: 'new description' }, id: project.id, format: :json
end end
it 'to be able to perform update action' do it 'to be able to perform update action' do
expect(response).to be_success expect(response).to be_success
end expect(project.reload.description).to eq 'new description'
it 'ensures that description has been updated' do
expect(@project.reload.description).to eq 'new description'
end end
end end
context 'api project user with add_member rights' do context 'api project user with add_member rights' do
let(:member) { FactoryGirl.create(:user) } let(:member) { FactoryGirl.create(:user) }
before do before do
put :add_member, member_id: member.id, type: 'User', role: 'admin', id: @project.id, format: :json put :add_member, member_id: member.id, type: 'User', role: 'admin', id: project.id, format: :json
end end
it 'to be able to perform add_member action' do it 'to be able to perform add_member action' do
expect(response).to be_success expect(response).to be_success
end expect(project.members).to include(member)
it 'ensures that new member has been added to project' do
expect(@project.members).to include(member)
end end
end end
context 'api project user with remove_member rights' do context 'api project user with remove_member rights' do
let(:member) { FactoryGirl.create(:user) } let(:member) { FactoryGirl.create(:user) }
before do before do
@project.add_member(member) project.add_member(member)
delete :remove_member, member_id: member.id, type: 'User', id: @project.id, format: :json delete :remove_member, member_id: member.id, type: 'User', id: project.id, format: :json
end end
it 'to be able to perform remove_member action' do it 'to be able to perform remove_member action' do
expect(response).to be_success expect(response).to be_success
end expect(project.members).to_not include(member)
it 'ensures that member has been removed from project' do
expect(@project.members).to_not include(member)
end end
end end
context 'api group user with update_member rights' do context 'api group user with update_member rights' do
let(:member) { FactoryGirl.create(:user) } let(:member) { FactoryGirl.create(:user) }
before do before do
@project.add_member(member) project.add_member(member)
put :update_member, member_id: member.id, type: 'User', role: 'reader', id: @project.id, format: :json put :update_member, member_id: member.id, type: 'User', role: 'reader', id: project.id, format: :json
end end
it 'to be able to perform update_member action' do it 'to be able to perform update_member action' do
expect(response).to be_success expect(response).to be_success
end role = project.relations.by_actor(member).first.role
it 'ensures that member role has been updated in project' do
role = @project.relations.by_actor(member).first.role
expect(role).to eq 'reader' expect(role).to eq 'reader'
end end
end end
@ -192,112 +178,106 @@ end
shared_examples_for 'api projects user without admin rights' do shared_examples_for 'api projects user without admin rights' do
it "to not be able to perform members action" do it "to not be able to perform members action" do
get :members, id: @project.id, format: :json get :members, id: project.id, format: :json
expect(response).to_not be_success expect(response).to_not be_success
end end
context 'api project user without update_member rights' do context 'api project user without update_member rights' do
let(:member) { FactoryGirl.create(:user) } let(:member) { FactoryGirl.create(:user) }
before do before do
@project.add_member(member) project.add_member(member)
put :update_member, member_id: member.id, type: 'User', role: 'reader', id: @project.id, format: :json put :update_member, member_id: member.id, type: 'User', role: 'reader', id: project.id, format: :json
end end
it 'to not be able to perform update_member action' do it 'to not be able to perform update_member action' do
expect(response).to_not be_success expect(response).to_not be_success
end role = project.relations.by_actor(member).first.role
it 'ensures that member role has not been updated in project' do
role = @project.relations.by_actor(member).first.role
expect(role).to_not eq 'reader' expect(role).to_not eq 'reader'
end end
end end
context 'api project user without update rights' do context 'api project user without update rights' do
before do before do
put :update, project: {description: 'new description'}, id: @project.id, format: :json put :update, project: {description: 'new description'}, id: project.id, format: :json
end end
it 'to not be able to perform update action' do it 'to not be able to perform update action' do
expect(response).to_not be_success expect(response).to_not be_success
end expect(project.reload.description).to_not eq 'new description'
it 'ensures that project has not been updated' do
expect(@project.reload.description).to_not eq 'new description'
end end
end end
context 'api project user without add_member rights' do context 'api project user without add_member rights' do
let(:member) { FactoryGirl.create(:user) } let(:member) { FactoryGirl.create(:user) }
before do before do
put :add_member, member_id: member.id, type: 'User', role: 'admin', id: @project.id, format: :json put :add_member, member_id: member.id, type: 'User', role: 'admin', id: project.id, format: :json
end end
it 'to not be able to perform add_member action' do it 'to not be able to perform add_member action' do
expect(response).to_not be_success expect(response).to_not be_success
end expect(project.members).to_not include(member)
it 'ensures that new member has not been added to project' do
expect(@project.members).to_not include(member)
end end
end end
context 'api project user without remove_member rights' do context 'api project user without remove_member rights' do
let(:member) { FactoryGirl.create(:user) } let(:member) { FactoryGirl.create(:user) }
before do before do
@project.add_member(member) project.add_member(member)
delete :remove_member, member_id: member.id, type: 'User', id: @project.id, format: :json delete :remove_member, member_id: member.id, type: 'User', id: project.id, format: :json
end end
it 'to be able to perform update action' do it 'to be able to perform update action' do
expect(response).to_not be_success expect(response).to_not be_success
end expect(project.members).to include(member)
it 'ensures that member has not been removed from project' do
expect(@project.members).to include(member)
end end
end end
end end
shared_examples_for 'api projects user with owner rights' do shared_examples_for 'api projects user with owner rights' do
before { project } # init
context 'api project user with destroy rights' do context 'api project user with destroy rights' do
it 'to be able to perform destroy action' do it 'to be able to perform destroy action' do
delete :destroy, id: @project.id, format: :json
expect(response).to be_success
end
it 'ensures that project has been destroyed' do
expect do expect do
delete :destroy, id: @project.id, format: :json delete :destroy, id: project.id, format: :json
end.to change(Project, :count).by(-1) end.to change(Project, :count).by(-1)
expect(response).to be_success
end end
end end
end end
shared_examples_for 'api projects user without owner rights' do shared_examples_for 'api projects user without owner rights' do
before { project } # init
context 'api project user with destroy rights' do context 'api project user with destroy rights' do
it 'to not be able to perform destroy action' do it 'to not be able to perform destroy action' do
delete :destroy, id: @project.id, format: :json
expect(response).to_not be_success
end
it 'ensures that project has not been destroyed' do
expect do expect do
delete :destroy, id: @project.id, format: :json delete :destroy, id: project.id, format: :json
end.to_not change(Project, :count) end.to_not change(Project, :count)
expect(response).to_not be_success
end end
end end
end end
describe Api::V1::ProjectsController, type: :controller do describe Api::V1::ProjectsController, type: :controller do
before(:each) do let(:project) { FactoryGirl.create(:project) }
let(:hidden_project) { FactoryGirl.create(:project) }
let(:another_user) { FactoryGirl.create(:user) }
before do
stub_symlink_methods stub_symlink_methods
@project = FactoryGirl.create(:project) # project = FactoryGirl.create(:project)
@hidden_project = FactoryGirl.create(:project) # hidden_project = FactoryGirl.create(:project)
@another_user = FactoryGirl.create(:user) # another_user = FactoryGirl.create(:user)
end end
context 'for guest' do context 'for guest' do
[:index, :members].each do |action| [:index, :members].each do |action|
it "to not be able to perform #{action} action" do it "to not be able to perform #{action} action" do
get action, id: @project.id, format: :json get action, id: project.id, format: :json
expect(response).to_not be_success expect(response).to_not be_success
end end
end end
@ -315,9 +295,10 @@ describe Api::V1::ProjectsController, type: :controller do
end end
context 'for simple user' do context 'for simple user' do
before(:each) do let(:user) { FactoryGirl.create(:user) }
@user = FactoryGirl.create(:user)
http_login(@user) before do
http_login(user)
end end
it 'to be able to perform index action' do it 'to be able to perform index action' do
@ -326,7 +307,7 @@ describe Api::V1::ProjectsController, type: :controller do
end end
context 'api project user with create rights' do context 'api project user with create rights' do
let(:params) { {project: {name: 'test_name', owner_id: @user.id, owner_type: 'User', visibility: 'open'}, format: :json} } let(:params) { {project: {name: 'test_name', owner_id: user.id, owner_type: 'User', visibility: 'open'}, format: :json} }
it 'to be able to perform create action' do it 'to be able to perform create action' do
post :create, params, format: :json post :create, params, format: :json
expect(response).to be_success expect(response).to be_success
@ -339,7 +320,7 @@ describe Api::V1::ProjectsController, type: :controller do
it 'writer group to be able to create project for their group' do it 'writer group to be able to create project for their group' do
group = FactoryGirl.create(:group) group = FactoryGirl.create(:group)
create_actor_relation(group, @user, 'writer') create_actor_relation(group, user, 'writer')
expect do expect do
post :create, params.deep_merge({project: {owner_type: 'Group', owner_id: group.id}}) post :create, params.deep_merge({project: {owner_type: 'Group', owner_id: group.id}})
end.to change(Project, :count).by(1) end.to change(Project, :count).by(1)
@ -347,7 +328,7 @@ describe Api::V1::ProjectsController, type: :controller do
it 'reader group to not be able to create project for their group' do it 'reader group to not be able to create project for their group' do
group = FactoryGirl.create(:group) group = FactoryGirl.create(:group)
create_actor_relation(group, @user, 'reader') create_actor_relation(group, user, 'reader')
expect do expect do
post :create, params.deep_merge({project: {owner_type: 'Group', owner_id: group.id}}) post :create, params.deep_merge({project: {owner_type: 'Group', owner_id: group.id}})
end.to_not change(Project, :count) end.to_not change(Project, :count)
@ -362,48 +343,53 @@ describe Api::V1::ProjectsController, type: :controller do
it_should_behave_like 'api projects user without owner rights' it_should_behave_like 'api projects user without owner rights'
context 'group writer' do context 'group writer' do
before { project } # init
it 'to be able to fork project to their group' do it 'to be able to fork project to their group' do
group = FactoryGirl.create(:group) group = FactoryGirl.create(:group)
create_actor_relation(group, @user, 'writer') create_actor_relation(group, user, 'writer')
expect do expect do
post :fork, id: @project.id, group_id: group.id, format: :json post :fork, id: project.id, group_id: group.id, format: :json
end.to change(Project, :count).by(1) end.to change(Project, :count).by(1)
end end
it 'to be able to fork project with different name to their group' do it 'to be able to fork project with different name to their group' do
group = FactoryGirl.create(:group) group = FactoryGirl.create(:group)
create_actor_relation(group, @user, 'writer') create_actor_relation(group, user, 'writer')
new_name = @project.name + '_forked' new_name = project.name + '_forked'
expect do expect do
post :fork, id: @project.id, group_id: group.id, fork_name: new_name, format: :json post :fork, id: project.id, group_id: group.id, fork_name: new_name, format: :json
end.to change { Project.where(name: new_name).count }.by(1) end.to change { Project.where(name: new_name).count }.by(1)
end end
end end
context 'group reader' do context 'group reader' do
before { project } # init
it 'to not be able to fork project to their group' do it 'to not be able to fork project to their group' do
group = FactoryGirl.create(:group) group = FactoryGirl.create(:group)
create_actor_relation(group, @user, 'reader') create_actor_relation(group, user, 'reader')
expect do expect do
post :fork, id: @project.id, group_id: group.id, format: :json post :fork, id: project.id, group_id: group.id, format: :json
end.to_not change(Project, :count) end.to_not change(Project, :count)
end end
it 'to not be able to fork project with different name to their group' do it 'to not be able to fork project with different name to their group' do
group = FactoryGirl.create(:group) group = FactoryGirl.create(:group)
new_name = @project.name + '_forked' new_name = project.name + '_forked'
create_actor_relation(group, @user, 'reader') create_actor_relation(group, user, 'reader')
expect do expect do
post :fork, id: @project.id, group_id: group.id, fork_name: new_name, format: :json post :fork, id: project.id, group_id: group.id, fork_name: new_name, format: :json
end.to_not change{ Project.where(name: new_name).count } end.to_not change{ Project.where(name: new_name).count }
end end
end end
end end
context 'for admin' do context 'for admin' do
before(:each) do let(:admin) { FactoryGirl.create(:admin) }
@admin = FactoryGirl.create(:admin)
http_login(@admin) before do
http_login(admin)
end end
it_should_behave_like 'api projects user with reader rights' it_should_behave_like 'api projects user with reader rights'
@ -415,10 +401,11 @@ describe Api::V1::ProjectsController, type: :controller do
end end
context 'for owner user' do context 'for owner user' do
before(:each) do let(:user) { FactoryGirl.create(:user) }
@user = FactoryGirl.create(:user) let(:project) { FactoryGirl.create(:project, owner: user) }
http_login(@user)
@project = FactoryGirl.create(:project, owner: @user) before do
http_login(user)
end end
it_should_behave_like 'api projects user with reader rights' it_should_behave_like 'api projects user with reader rights'
@ -430,10 +417,11 @@ describe Api::V1::ProjectsController, type: :controller do
end end
context 'for reader user' do context 'for reader user' do
before(:each) do let(:user) { FactoryGirl.create(:user) }
@user = FactoryGirl.create(:user)
http_login(@user) before do
create_relation(@project, @user, 'reader') http_login(user)
create_relation(project, user, 'reader')
end end
it_should_behave_like 'api projects user with reader rights' it_should_behave_like 'api projects user with reader rights'
@ -445,10 +433,11 @@ describe Api::V1::ProjectsController, type: :controller do
end end
context 'for writer user' do context 'for writer user' do
before(:each) do let(:user) { FactoryGirl.create(:user) }
@user = FactoryGirl.create(:user)
http_login(@user) before do
create_relation(@project, @user, 'writer') http_login(user)
create_relation(project, user, 'writer')
end end
it_should_behave_like 'api projects user with reader rights' it_should_behave_like 'api projects user with reader rights'
@ -460,11 +449,12 @@ describe Api::V1::ProjectsController, type: :controller do
end end
context 'for group' do context 'for group' do
before(:each) do let(:group) { FactoryGirl.create(:group) }
@group = FactoryGirl.create(:group) let(:group_user) { FactoryGirl.create(:user) }
@group_user = FactoryGirl.create(:user)
# @project.relations.destroy_all before do
http_login(@group_user) # project.relations.destroy_all
http_login(group_user)
end end
context 'with no relations to project' do context 'with no relations to project' do
@ -477,12 +467,10 @@ describe Api::V1::ProjectsController, type: :controller do
end end
context 'owner of the project' do context 'owner of the project' do
before(:each) do let(:project) { FactoryGirl.create(:project, owner: group) }
@project = FactoryGirl.create(:project, owner: @group)
end
context 'reader user' do context 'reader user' do
before(:each) { create_actor_relation(@group, @group_user, 'reader') } before { create_actor_relation(group, group_user, 'reader') }
it_should_behave_like 'api projects user with reader rights' it_should_behave_like 'api projects user with reader rights'
it_should_behave_like 'api projects user with reader rights for hidden project' it_should_behave_like 'api projects user with reader rights for hidden project'
@ -493,7 +481,7 @@ describe Api::V1::ProjectsController, type: :controller do
end end
context 'admin user' do context 'admin user' do
before(:each) { create_actor_relation(@group, @group_user, 'admin') } before { create_actor_relation(group, group_user, 'admin') }
it_should_behave_like 'api projects user with reader rights' it_should_behave_like 'api projects user with reader rights'
it_should_behave_like 'api projects user with reader rights for hidden project' it_should_behave_like 'api projects user with reader rights for hidden project'
@ -506,12 +494,12 @@ describe Api::V1::ProjectsController, type: :controller do
context 'member of the project' do context 'member of the project' do
context 'with admin rights' do context 'with admin rights' do
before(:each) do before do
create_relation(@project, @group, 'admin') create_relation(project, group, 'admin')
end end
context 'reader user' do context 'reader user' do
before(:each) { create_actor_relation(@group, @group_user, 'reader') } before { create_actor_relation(group, group_user, 'reader') }
it_should_behave_like 'api projects user with reader rights' it_should_behave_like 'api projects user with reader rights'
it_should_behave_like 'api projects user with reader rights for hidden project' it_should_behave_like 'api projects user with reader rights for hidden project'
@ -522,7 +510,7 @@ describe Api::V1::ProjectsController, type: :controller do
end end
context 'admin user' do context 'admin user' do
before(:each) { create_actor_relation(@group, @group_user, 'admin') } before { create_actor_relation(group, group_user, 'admin') }
it_should_behave_like 'api projects user with reader rights' it_should_behave_like 'api projects user with reader rights'
it_should_behave_like 'api projects user with reader rights for hidden project' it_should_behave_like 'api projects user with reader rights for hidden project'
@ -534,10 +522,10 @@ describe Api::V1::ProjectsController, type: :controller do
end end
context 'with reader rights' do context 'with reader rights' do
before(:each) { create_relation(@project, @group, 'reader') } before { create_relation(project, group, 'reader') }
context 'reader user' do context 'reader user' do
before(:each) { create_actor_relation(@group, @group_user, 'reader') } before { create_actor_relation(group, group_user, 'reader') }
it_should_behave_like 'api projects user with reader rights' it_should_behave_like 'api projects user with reader rights'
it_should_behave_like 'api projects user with reader rights for hidden project' it_should_behave_like 'api projects user with reader rights for hidden project'
@ -547,7 +535,7 @@ describe Api::V1::ProjectsController, type: :controller do
it_should_behave_like 'api projects user without owner rights' it_should_behave_like 'api projects user without owner rights'
context 'user should has best role' do context 'user should has best role' do
before(:each) { create_relation(@project, @group_user, 'admin') } before { create_relation(project, group_user, 'admin') }
it_should_behave_like 'api projects user with reader rights' it_should_behave_like 'api projects user with reader rights'
it_should_behave_like 'api projects user with fork rights' it_should_behave_like 'api projects user with fork rights'
@ -557,8 +545,9 @@ describe Api::V1::ProjectsController, type: :controller do
end end
end end
context 'admin user' do context 'admin user' do
before(:each) { create_actor_relation(@group, @group_user, 'admin') } before { create_actor_relation(group, group_user, 'admin') }
it_should_behave_like 'api projects user with reader rights' it_should_behave_like 'api projects user with reader rights'
it_should_behave_like 'api projects user with reader rights for hidden project' it_should_behave_like 'api projects user with reader rights for hidden project'