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/issuables_helper_spec.rb')
-rw-r--r--spec/helpers/issuables_helper_spec.rb26
1 files changed, 25 insertions, 1 deletions
diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb
index 0e3752f220e..57845904d32 100644
--- a/spec/helpers/issuables_helper_spec.rb
+++ b/spec/helpers/issuables_helper_spec.rb
@@ -44,6 +44,30 @@ RSpec.describe IssuablesHelper do
end
end
+ describe '#issuable_meta' do
+ let(:user) { create(:user) }
+
+ let_it_be(:project) { create(:project) }
+
+ describe 'author status' do
+ let(:issuable) { build(:merge_request, source_project: project, author: user, created_at: '2020-01-30') }
+
+ it 'displays an emoji if the user status is set' do
+ user.status = UserStatus.new(message: 'lol')
+ content = helper.issuable_meta(issuable, project)
+ expect(content).to match('<span class="user-status-emoji has-tooltip" title="lol" data-html="true" data-placement="top">')
+ expect(content).to match('<gl-emoji title="speech balloon" data-name="speech_balloon" data-unicode-version="6.0">')
+ end
+
+ it 'does not displays an emoji if the user status is not set' do
+ user.status = UserStatus.new
+ content = helper.issuable_meta(issuable, project)
+ expect(content).not_to match('class="user-status-emoji has-tooltip"')
+ expect(content).not_to match('gl-emoji')
+ end
+ end
+ end
+
describe '#issuables_state_counter_text' do
let(:user) { create(:user) }
@@ -194,7 +218,7 @@ RSpec.describe IssuablesHelper do
assign(:project, issue.project)
end
- it 'sets sentryIssueIdentifier to nil with no sentry issue ' do
+ it 'sets sentryIssueIdentifier to nil with no sentry issue' do
expect(helper.issuable_initial_data(issue)[:sentryIssueIdentifier])
.to be_nil
end