Commit 0b708e5d authored by Fabio Papa's avatar Fabio Papa

Style rules; Revert some examples

parent 6f3b2e07
...@@ -70,13 +70,11 @@ describe Admin::GroupsController do ...@@ -70,13 +70,11 @@ describe Admin::GroupsController do
end end
it 'updates the subgroup_creation_level successfully' do it 'updates the subgroup_creation_level successfully' do
OWNER = ::Gitlab::Access::OWNER_SUBGROUP_ACCESS
expect do expect do
post :update, post :update,
params: { id: group.to_param, params: { id: group.to_param,
group: { subgroup_creation_level: OWNER } } group: { subgroup_creation_level: ::Gitlab::Access::OWNER_SUBGROUP_ACCESS } }
end.to change { group.reload.subgroup_creation_level }.to(OWNER) end.to change { group.reload.subgroup_creation_level }.to(::Gitlab::Access::OWNER_SUBGROUP_ACCESS)
end end
end end
end end
...@@ -996,9 +996,11 @@ describe Group do ...@@ -996,9 +996,11 @@ describe Group do
end end
describe 'subgroup_creation_level' do describe 'subgroup_creation_level' do
it 'defaults to maintainers' do it 'outputs the default one if it is nil' do
group = create(:group, subgroup_creation_level: nil)
expect(group.subgroup_creation_level) expect(group.subgroup_creation_level)
.to eq(Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS) .to eq(::Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS)
end end
end end
end end
...@@ -803,10 +803,10 @@ describe API::Groups do ...@@ -803,10 +803,10 @@ describe API::Groups do
group2.add_maintainer(user1) group2.add_maintainer(user1)
end end
it 'can create subgroups' do it 'cannot create subgroups' do
post api("/groups", user1), params: { parent_id: group2.id, name: 'foo', path: 'foo' } post api("/groups", user1), params: { parent_id: group2.id, name: 'foo', path: 'foo' }
expect(response).to have_gitlab_http_status(201) expect(response).to have_gitlab_http_status(403)
end end
end end
end end
......
...@@ -89,9 +89,9 @@ describe Groups::CreateService, '#execute' do ...@@ -89,9 +89,9 @@ describe Groups::CreateService, '#execute' do
it { is_expected.to be_persisted } it { is_expected.to be_persisted }
end end
context 'as maintainer' do context 'as Owner' do
before do before do
group.add_maintainer(user) group.add_owner(user)
end end
it { is_expected.to be_persisted } it { is_expected.to be_persisted }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment