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:
Diffstat (limited to 'spec/helpers/avatars_helper_spec.rb')
-rw-r--r--spec/helpers/avatars_helper_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/helpers/avatars_helper_spec.rb b/spec/helpers/avatars_helper_spec.rb
new file mode 100644
index 00000000000..581726c1d0e
--- /dev/null
+++ b/spec/helpers/avatars_helper_spec.rb
@@ -0,0 +1,21 @@
+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
+ is_expected.to include(CGI.escapeHTML(user.avatar_url(16)))
+ end
+ end
+end