summaryrefslogtreecommitdiff
path: root/spec/features/issues/notes_on_issues_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/issues/notes_on_issues_spec.rb')
-rw-r--r--spec/features/issues/notes_on_issues_spec.rb23
1 files changed, 19 insertions, 4 deletions
diff --git a/spec/features/issues/notes_on_issues_spec.rb b/spec/features/issues/notes_on_issues_spec.rb
index f08c73f947c..fed77453cbb 100644
--- a/spec/features/issues/notes_on_issues_spec.rb
+++ b/spec/features/issues/notes_on_issues_spec.rb
@@ -3,6 +3,12 @@ require 'spec_helper'
describe 'Create notes on issues', :js do
let(:user) { create(:user) }
+ def submit_comment(text)
+ fill_in 'note[note]', with: text
+ click_button 'Comment'
+ wait_for_requests
+ end
+
shared_examples 'notes with reference' do
let(:issue) { create(:issue, project: project) }
let(:note_text) { "Check #{mention.to_reference}" }
@@ -12,10 +18,7 @@ describe 'Create notes on issues', :js do
sign_in(user)
visit project_issue_path(project, issue)
- fill_in 'note[note]', with: note_text
- click_button 'Comment'
-
- wait_for_requests
+ submit_comment(note_text)
end
it 'creates a note with reference and cross references the issue' do
@@ -74,4 +77,16 @@ describe 'Create notes on issues', :js do
let(:mention) { create(:merge_request, source_project: project) }
end
end
+
+ it 'highlights the current user in a comment' do
+ project = create(:project)
+ issue = create(:issue, project: project)
+ project.add_developer(user)
+ sign_in(user)
+
+ visit project_issue_path(project, issue)
+ submit_comment("@#{user.username} note to self")
+
+ expect(page).to have_selector '.gfm-project_member.current-user', text: user.username
+ end
end