2017-03-23 04:43:34 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe UsersHelper do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
describe '#user_link' do
|
|
|
|
subject { helper.user_link(user) }
|
|
|
|
|
|
|
|
it "links to the user's profile" do
|
|
|
|
is_expected.to include("href=\"#{user_path(user)}\"")
|
|
|
|
end
|
|
|
|
|
|
|
|
it "has the user's email as title" do
|
|
|
|
is_expected.to include("title=\"#{user.email}\"")
|
|
|
|
end
|
|
|
|
end
|
2017-12-11 09:21:06 -05:00
|
|
|
|
|
|
|
describe '#profile_tabs' do
|
|
|
|
subject(:tabs) { helper.profile_tabs }
|
|
|
|
|
|
|
|
before do
|
|
|
|
allow(helper).to receive(:current_user).and_return(user)
|
|
|
|
allow(helper).to receive(:can?).and_return(true)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'includes all the expected tabs' do
|
|
|
|
expect(tabs).to include(:activity, :groups, :contributed, :projects, :snippets)
|
|
|
|
end
|
|
|
|
end
|
2017-03-23 04:43:34 -04:00
|
|
|
end
|