gitlab-org--gitlab-foss/spec/helpers/users_helper_spec.rb
2018-02-22 17:11:36 +01:00

30 lines
731 B
Ruby

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
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
end