summaryrefslogtreecommitdiff
path: root/spec/services/groups
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-03-20 23:09:33 +0100
committerDouwe Maan <douwe@selenight.nl>2016-03-20 23:09:33 +0100
commit19aa20d528aca670fd22954e08bf05f2f7a8fe32 (patch)
treee9fd4fd51a783fcc300aa6029f10499dfb3822b7 /spec/services/groups
parent7c51d5efecdad1a7f52ffecdf57c86b7b90ca166 (diff)
downloadgitlab-ce-19aa20d528aca670fd22954e08bf05f2f7a8fe32.tar.gz
Fix more specs
Diffstat (limited to 'spec/services/groups')
-rw-r--r--spec/services/groups/update_service_spec.rb30
1 files changed, 14 insertions, 16 deletions
diff --git a/spec/services/groups/update_service_spec.rb b/spec/services/groups/update_service_spec.rb
index 9d427ff2d90..7732482cdaa 100644
--- a/spec/services/groups/update_service_spec.rb
+++ b/spec/services/groups/update_service_spec.rb
@@ -6,9 +6,8 @@ describe Groups::UpdateService, services: true do
let!(:internal_group) { create(:group, :internal) }
let!(:public_group) { create(:group, :public) }
- describe "execute" do
+ describe "#execute" do
context "project visibility_level validation" do
-
context "public group with public projects" do
let!(:service) { described_class.new(public_group, user, visibility_level: Gitlab::VisibilityLevel::INTERNAL ) }
@@ -18,33 +17,32 @@ describe Groups::UpdateService, services: true do
end
it "cant downgrade permission level" do
- expect(service.execute).to be_falsy
expect(public_group.errors.count).to eq(2)
end
end
context "internal group with internal project" do
- let!(:service) { described_class.new(internal_group, user, visibility_level: Gitlab::VisibilityLevel::PRIVATE ) }
-
- before do
- internal_group.add_user(user, Gitlab::Access::MASTER)
- create(:project, :internal, group: internal_group)
- end
-
- it "cant downgrade permission level" do
- expect(service.execute).to be_falsy
- expect(internal_group.errors.count).to eq(2)
- end
+ let!(:service) { described_class.new(internal_group, user, visibility_level: Gitlab::VisibilityLevel::PRIVATE ) }
+
+ before do
+ internal_group.add_user(user, Gitlab::Access::MASTER)
+ create(:project, :internal, group: internal_group)
+ end
+
+ it "cant downgrade permission level" do
+ expect(internal_group.errors.count).to eq(2)
end
+ end
end
end
context "unauthorized visibility_level validation" do
let!(:service) { described_class.new(internal_group, user, visibility_level: 99 ) }
- before { internal_group.add_user(user, Gitlab::Access::MASTER) }
+ before do
+ internal_group.add_user(user, Gitlab::Access::MASTER)
+ end
it "does not change permission level" do
- expect(service.execute).to be_falsy
expect(internal_group.errors.count).to eq(1)
end
end