From f1d3ea63cf74d2791a9a863b29ab2d919ea61bd0 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 16 Jul 2018 18:18:52 +0200 Subject: Show the status of a user in interactions The status is shown for - The author of a commit when viewing a commit - Notes on a commit (regular/diff) - The user that triggered a pipeline when viewing a pipeline - The author of a merge request when viewing a merge request - The author of notes on a merge request (regular/diff) - The author of an issue when viewing an issue - The author of notes on an issue - The author of a snippet when viewing a snippet - The author of notes on a snippet - A user's profile page - The list of members of a group/user --- spec/features/snippets/notes_on_personal_snippets_spec.rb | 11 +++++++++++ spec/features/snippets/show_spec.rb | 8 ++++++++ 2 files changed, 19 insertions(+) (limited to 'spec/features/snippets') diff --git a/spec/features/snippets/notes_on_personal_snippets_spec.rb b/spec/features/snippets/notes_on_personal_snippets_spec.rb index 269351e55c9..1442e011d52 100644 --- a/spec/features/snippets/notes_on_personal_snippets_spec.rb +++ b/spec/features/snippets/notes_on_personal_snippets_spec.rb @@ -16,6 +16,8 @@ describe 'Comments on personal snippets', :js do before do sign_in user visit snippet_path(snippet) + + wait_for_requests end subject { page } @@ -42,6 +44,15 @@ describe 'Comments on personal snippets', :js do expect(page).to have_selector('.note-emoji-button') end end + + it 'shows the status of a note author' do + status = create(:user_status, user: user) + visit snippet_path(snippet) + + within("#note_#{snippet_notes[0].id}") do + expect(page).to show_user_status(status) + end + end end context 'when submitting a note' do diff --git a/spec/features/snippets/show_spec.rb b/spec/features/snippets/show_spec.rb index f31457db92f..3fe0b60b18f 100644 --- a/spec/features/snippets/show_spec.rb +++ b/spec/features/snippets/show_spec.rb @@ -155,4 +155,12 @@ describe 'Snippet', :js do end end end + + it_behaves_like 'showing user status' do + let(:file_name) { 'popen.rb' } + let(:content) { project.repository.blob_at('master', 'files/ruby/popen.rb').data } + let(:user_with_status) { snippet.author } + + subject { visit snippet_path(snippet) } + end end -- cgit v1.2.1