summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/discussions_controller_spec.rb
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2018-02-28 00:10:43 +0000
committerJacob Schatz <jschatz@gitlab.com>2018-02-28 00:10:43 +0000
commit059ab73b8eae3a546d0a19fe99ef0c52df5fac01 (patch)
treeb24d4162072c0099147fcdb4f19f95511689ff6e /spec/controllers/projects/discussions_controller_spec.rb
parent0be4a77d0012613f960c4177f53101c46de2899c (diff)
downloadgitlab-ce-059ab73b8eae3a546d0a19fe99ef0c52df5fac01.tar.gz
Render MR Notes with Vue with behind a cookie
Diffstat (limited to 'spec/controllers/projects/discussions_controller_spec.rb')
-rw-r--r--spec/controllers/projects/discussions_controller_spec.rb26
1 files changed, 26 insertions, 0 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