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:
authorDouwe Maan <douwe@selenight.nl>2016-03-20 23:03:53 +0300
committerDouwe Maan <douwe@selenight.nl>2016-03-20 23:04:07 +0300
commit8db1292139cfdac4c29c03b876b68b9e752cf75a (patch)
tree2fcf67ada482ecf4ac90f39c858334a62b709618 /spec/helpers/groups_helper_spec.rb
parent2eb19ea3ea36916bbea72a8ccab3e6d15f602ac9 (diff)
Tweaks, refactoring, and specs
Diffstat (limited to 'spec/helpers/groups_helper_spec.rb')
-rw-r--r--spec/helpers/groups_helper_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/helpers/groups_helper_spec.rb b/spec/helpers/groups_helper_spec.rb
new file mode 100644
index 00000000000..4ea90a80a92
--- /dev/null
+++ b/spec/helpers/groups_helper_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe GroupsHelper do
+ describe 'group_icon' do
+ avatar_file_path = File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
+
+ it 'should return an url for the avatar' do
+ group = create(:group)
+ group.avatar = File.open(avatar_file_path)
+ group.save!
+ expect(group_icon(group.path).to_s).
+ to match("/uploads/group/avatar/#{group.id}/banana_sample.gif")
+ end
+
+ it 'should give default avatar_icon when no avatar is present' do
+ group = create(:group)
+ group.save!
+ expect(group_icon(group.path)).to match('group_avatar.png')
+ end
+ end
+end