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:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-07-16 19:18:52 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-07-30 16:01:26 +0300
commitf1d3ea63cf74d2791a9a863b29ab2d919ea61bd0 (patch)
treec36c2b272fba917af321a4f16c34a5047407f3b2 /spec/controllers
parentb4c4b48a8c0258ff266c523488aa169a1b5ea0f3 (diff)
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
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/projects/issues_controller_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb
index ff1835a34c2..5b347b1109a 100644
--- a/spec/controllers/projects/issues_controller_spec.rb
+++ b/spec/controllers/projects/issues_controller_spec.rb
@@ -993,6 +993,29 @@ describe Projects::IssuesController do
expect(json_response.first.keys).to match_array(%w[id reply_id expanded notes diff_discussion discussion_path individual_note resolvable resolved resolved_at resolved_by resolved_by_push commit_id for_commit project_id])
end
+ it 'renders the author status html if there is a status' do
+ create(:user_status, user: discussion.author)
+
+ get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid
+
+ note_json = json_response.first['notes'].first
+
+ expect(note_json['author']['status_tooltip_html']).to be_present
+ end
+
+ it 'does not cause an extra query for the status' do
+ control = ActiveRecord::QueryRecorder.new do
+ get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid
+ end
+
+ create(:user_status, user: discussion.author)
+ second_discussion = create(:discussion_note_on_issue, noteable: issue, project: issue.project, author: create(:user))
+ create(:user_status, user: second_discussion.author)
+
+ expect { get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid }
+ .not_to exceed_query_limit(control)
+ end
+
context 'with cross-reference system note', :request_store do
let(:new_issue) { create(:issue) }
let(:cross_reference) { "mentioned in #{new_issue.to_reference(issue.project)}" }