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/features/issues/user_views_issue_spec.rb')
-rw-r--r--spec/features/issues/user_views_issue_spec.rb26
1 files changed, 23 insertions, 3 deletions
diff --git a/spec/features/issues/user_views_issue_spec.rb b/spec/features/issues/user_views_issue_spec.rb
index dd04ac94105..2b610bab9f0 100644
--- a/spec/features/issues/user_views_issue_spec.rb
+++ b/spec/features/issues/user_views_issue_spec.rb
@@ -2,7 +2,7 @@
require "spec_helper"
-describe "User views issue" do
+RSpec.describe "User views issue" do
let(:project) { create(:project_empty_repo, :public) }
let(:user) { create(:user) }
let(:issue) { create(:issue, project: project, description: "# Description header", author: user) }
@@ -35,18 +35,38 @@ describe "User views issue" do
describe 'user status' do
subject { visit(project_issue_path(project, issue)) }
- describe 'showing status of the author of the issue' do
+ context 'when showing status of the author of the issue' do
it_behaves_like 'showing user status' do
let(:user_with_status) { issue.author }
end
end
- describe 'showing status of a user who commented on an issue', :js do
+ context 'when showing status of a user who commented on an issue', :js do
let!(:note) { create(:note, noteable: issue, project: project, author: user_with_status) }
it_behaves_like 'showing user status' do
let(:user_with_status) { create(:user) }
end
end
+
+ context 'when status message has an emoji', :js do
+ let(:message) { 'My status with an emoji' }
+ let(:message_emoji) { 'basketball' }
+
+ let!(:note) { create(:note, noteable: issue, project: project, author: user) }
+ let!(:status) { create(:user_status, user: user, emoji: 'smirk', message: "#{message} :#{message_emoji}:") }
+
+ it 'correctly renders the emoji' do
+ tooltip_span = page.first(".user-status-emoji[title^='#{message}']")
+
+ tooltip_span.hover
+
+ tooltip = page.find('.tooltip .tooltip-inner')
+
+ page.within(tooltip) do
+ expect(page).to have_emoji(message_emoji)
+ end
+ end
+ end
end
end