summaryrefslogtreecommitdiff
path: root/spec/models/group_spec.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-05-03 17:25:31 +0200
committerRémy Coutable <remy@rymai.me>2017-05-04 17:04:36 +0200
commitf1ace97f8bdc69edc481b545b779721322cec95c (patch)
treef7cc903c0c8b4b64e743a07016e0325d7d5c0fea /spec/models/group_spec.rb
parentd3768dd79698ae17cd0c82b7c78a8ead11b7e157 (diff)
downloadgitlab-ce-f1ace97f8bdc69edc481b545b779721322cec95c.tar.gz
Backport avatar-related spec changes from gitlab-org/gitlab-ee@4b464eaaeebackport-ee-4b464eaaee
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/models/group_spec.rb')
-rw-r--r--spec/models/group_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index a11805926cc..3d60e52f23f 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -175,6 +175,22 @@ describe Group, models: true do
end
end
+ describe '#avatar_url' do
+ let!(:group) { create(:group, :access_requestable, :with_avatar) }
+ let(:user) { create(:user) }
+ subject { group.avatar_url }
+
+ context 'when avatar file is uploaded' do
+ before do
+ group.add_master(user)
+ end
+
+ let(:avatar_path) { "/uploads/group/avatar/#{group.id}/dk.png" }
+
+ it { should eq "http://#{Gitlab.config.gitlab.host}#{avatar_path}" }
+ end
+ end
+
describe '.search' do
it 'returns groups with a matching name' do
expect(described_class.search(group.name)).to eq([group])