diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-12 14:51:41 -0700 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-12 14:51:41 -0700 |
| commit | bf0c04e5ff61cd68177e52c15128aea9b1a41427 (patch) | |
| tree | ad9a1283e9a85568287aef9e921ecfb577953fea /spec/helpers/groups_helper.rb | |
| parent | 7ac62388a5ba030dd60e6aef971eb32adf39ed0d (diff) | |
| download | gitlab-ce-bf0c04e5ff61cd68177e52c15128aea9b1a41427.tar.gz | |
Fix specs
Diffstat (limited to 'spec/helpers/groups_helper.rb')
| -rw-r--r-- | spec/helpers/groups_helper.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/helpers/groups_helper.rb b/spec/helpers/groups_helper.rb new file mode 100644 index 00000000000..3e99ab84ec9 --- /dev/null +++ b/spec/helpers/groups_helper.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +describe GroupsHelper do + describe 'group_icon' do + avatar_file_path = File.join(Rails.root, 'public', 'gitlab_logo.png') + + 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 }/gitlab_logo.png") + 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 |
