Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-03-23 11:43:34 +0300
committerToon Claes <toon@gitlab.com>2017-03-24 00:21:00 +0300
commit0759db802f053e2757d52a284fd29098a9473df2 (patch)
tree7a86a3d8fd10d7fda7f7581a194133d57970358d /spec/helpers/users_helper_spec.rb
parenta57890bcaa76d540aa675e0c89d50620c9d69018 (diff)
Move user_link to generic UsersHelper
Make the user_link helper more generic to be used for objects other than pipelines.
Diffstat (limited to 'spec/helpers/users_helper_spec.rb')
-rw-r--r--spec/helpers/users_helper_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb
new file mode 100644
index 00000000000..03f78de8e91
--- /dev/null
+++ b/spec/helpers/users_helper_spec.rb
@@ -0,0 +1,17 @@
+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
+end