diff options
author | Maxim Rydkin <maks.rydkin@gmail.com> | 2017-09-05 23:17:53 +0300 |
---|---|---|
committer | Maxim Rydkin <maks.rydkin@gmail.com> | 2017-09-07 13:16:14 +0300 |
commit | 0963ac363641c5552f6668705edcded4bad0259c (patch) | |
tree | 67a511f3373052978948f12e99474a687368a947 /spec/helpers | |
parent | c9d76b528c837f63f1052eb3f096bea4c8308e06 (diff) |
fix helper and spec
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/projects_helper_spec.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index 93a5b55e4d0..9a6fb4d6cb0 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -192,17 +192,20 @@ describe ProjectsHelper do end describe '#link_to_member_avatar' do - let(:user) { create(:user) } + let(:user) { build_stubbed(:user) } it 'returns image tag for member avatar' do - expect(helper.link_to_member_avatar(user)).to eq("<img width=\"16\" class=\"avatar avatar-inline s16 lazy\" alt=\"\" data-src=\"http://www.gravatar.com/avatar/a763e4acc6bc22cbabeae2638cfd4db4?s=32&d=identicon\" src=\"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" />") + allow(helper).to receive(:image_tag).with(nil, {width: 16, class: ["avatar", "avatar-inline", "s16"], alt: ""}) + allow(helper).to receive(:avatar_icon).with(user, 16) + + helper.link_to_member_avatar(user) end end describe '#link_to_member' do - let(:group) { create(:group) } - let(:project) { create(:project, group: group) } - let(:user) { create(:user) } + let(:group) { build_stubbed(:group) } + let(:project) { build_stubbed(:project, group: group) } + let(:user) { build_stubbed(:user) } describe 'using the default options' do it 'returns an HTML link to the user' do |