diff options
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/discussions_controller_spec.rb | 26 | ||||
-rw-r--r-- | spec/controllers/projects/issues_controller_spec.rb | 2 |
2 files changed, 27 insertions, 1 deletions
diff --git a/spec/controllers/projects/discussions_controller_spec.rb b/spec/controllers/projects/discussions_controller_spec.rb index 00328d3ea51..fcb0c2f28c8 100644 --- a/spec/controllers/projects/discussions_controller_spec.rb +++ b/spec/controllers/projects/discussions_controller_spec.rb @@ -71,6 +71,19 @@ describe Projects::DiscussionsController do expect(response).to have_gitlab_http_status(200) end + + context "when vue_mr_discussions cookie is present" do + before do + allow(controller).to receive(:cookies).and_return(vue_mr_discussions: 'true') + end + + it "renders discussion with serializer" do + expect_any_instance_of(DiscussionSerializer).to receive(:represent) + .with(instance_of(Discussion), { context: instance_of(described_class) }) + + post :resolve, request_params + end + end end end end @@ -119,6 +132,19 @@ describe Projects::DiscussionsController do expect(response).to have_gitlab_http_status(200) end + + context "when vue_mr_discussions cookie is present" do + before do + allow(controller).to receive(:cookies).and_return({ vue_mr_discussions: 'true' }) + end + + it "renders discussion with serializer" do + expect_any_instance_of(DiscussionSerializer).to receive(:represent) + .with(instance_of(Discussion), { context: instance_of(described_class) }) + + delete :unresolve, request_params + end + end end end end diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index 9656e7f7e74..9918d52e402 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -974,7 +974,7 @@ describe Projects::IssuesController do it 'returns discussion json' do get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid - expect(json_response.first.keys).to match_array(%w[id reply_id expanded notes individual_note]) + expect(json_response.first.keys).to match_array(%w[id reply_id expanded notes diff_discussion individual_note resolvable resolve_with_issue_path resolved]) end context 'with cross-reference system note', :request_store do |