Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2015-11-05 13:38:00 +0300
committerValery Sizov <valery@gitlab.com>2015-11-05 14:18:51 +0300
commit6051c28fc03b4d9928ee2f2855f210845f9c0579 (patch)
tree43447b26e57d81765f983ef38e34eb5b3ba10997 /spec/models/group_spec.rb
parent363900a3e7902cbda8f62b55eb2c30881b3dae3f (diff)
Allow groups to appear in the search results if the group owner allows it
Diffstat (limited to 'spec/models/group_spec.rb')
-rw-r--r--spec/models/group_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index 80638fc8db2..0f23e81ace9 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -84,4 +84,23 @@ describe Group do
expect(group.avatar_type).to eq(["only images allowed"])
end
end
+
+ describe "public_profile?" do
+ it "returns true for public group" do
+ group = create(:group, public: true)
+ expect(group.public_profile?).to be_truthy
+ end
+
+ it "returns true for non-public group with public project" do
+ group = create(:group)
+ create(:project, :public, group: group)
+ expect(group.public_profile?).to be_truthy
+ end
+
+ it "returns false for non-public group with no public projects" do
+ group = create(:group)
+ create(:project, group: group)
+ expect(group.public_profile?).to be_falsy
+ end
+ end
end