Fixed Test
This commit is contained in:
parent
1b75296875
commit
6168e33e9e
|
@ -9,10 +9,10 @@ module LazyImageTagHelper
|
||||||
|
|
||||||
unless options.delete(:lazy) == false
|
unless options.delete(:lazy) == false
|
||||||
options[:data] ||= {}
|
options[:data] ||= {}
|
||||||
unless options.delete(:use_original_source)
|
if options.delete(:use_original_source)
|
||||||
options[:data][:src] = path_to_image(source)
|
|
||||||
else
|
|
||||||
options[:data][:src] = source
|
options[:data][:src] = source
|
||||||
|
else
|
||||||
|
options[:data][:src] = path_to_image(source)
|
||||||
end
|
end
|
||||||
options[:class] ||= ""
|
options[:class] ||= ""
|
||||||
options[:class] << " lazy"
|
options[:class] << " lazy"
|
||||||
|
|
|
@ -48,9 +48,8 @@ describe GroupsHelper do
|
||||||
|
|
||||||
it 'returns an based url for the avatar if private' do
|
it 'returns an based url for the avatar if private' do
|
||||||
allow(ActionController::Base).to receive(:asset_host).and_return(asset_host)
|
allow(ActionController::Base).to receive(:asset_host).and_return(asset_host)
|
||||||
group = create(:group)
|
group = create(:group, :private)
|
||||||
group.avatar = fixture_file_upload(avatar_file_path)
|
group.avatar = fixture_file_upload(avatar_file_path)
|
||||||
group.private = true
|
|
||||||
group.save!
|
group.save!
|
||||||
expect(group_icon_url(group.path).to_s)
|
expect(group_icon_url(group.path).to_s)
|
||||||
.to match("/uploads/-/system/group/avatar/#{group.id}/banana_sample.gif")
|
.to match("/uploads/-/system/group/avatar/#{group.id}/banana_sample.gif")
|
||||||
|
|
Loading…
Reference in New Issue