2017-03-23 04:43:34 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe AvatarsHelper do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
describe '#user_avatar' do
|
|
|
|
subject { helper.user_avatar(user: user) }
|
|
|
|
|
|
|
|
it "links to the user's profile" do
|
|
|
|
is_expected.to include("href=\"#{user_path(user)}\"")
|
|
|
|
end
|
|
|
|
|
|
|
|
it "has the user's name as title" do
|
|
|
|
is_expected.to include("title=\"#{user.name}\"")
|
|
|
|
end
|
|
|
|
|
|
|
|
it "contains the user's avatar image" do
|
2017-05-10 00:26:17 -04:00
|
|
|
is_expected.to include(CGI.escapeHTML(user.avatar_url(size: 16)))
|
2017-03-23 04:43:34 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|