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:
authorPatrick Derichs <pderichs@gitlab.com>2019-07-26 10:10:27 +0300
committerPatrick Derichs <pderichs@gitlab.com>2019-07-26 10:10:36 +0300
commit355a2df560dea2719a027ada718a923ab7876ffe (patch)
treec9ac6d6c984e094d3b6173e193b7db8c211b834b /spec/support
parent08c03e7e17c090861f8ab9336ee71bbac78eaab3 (diff)
Use NotesFinder in module IssuableActions
Add spec for concern IssuableActions Add shared samples for discussions endpoint Add schema validations for discussions Fix rubocop style issue Make target assignable Use new possibility to provide target
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/shared_examples/discussions_provider_shared_examples.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/support/shared_examples/discussions_provider_shared_examples.rb b/spec/support/shared_examples/discussions_provider_shared_examples.rb
new file mode 100644
index 00000000000..77cf1ac3f51
--- /dev/null
+++ b/spec/support/shared_examples/discussions_provider_shared_examples.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+shared_examples 'discussions provider' do
+ it 'returns the expected discussions' do
+ get :discussions, params: { namespace_id: project.namespace, project_id: project, id: requested_iid }
+
+ expect(response).to have_gitlab_http_status(200)
+ expect(response).to match_response_schema('entities/discussions')
+
+ expect(json_response.size).to eq(expected_discussion_count)
+ expect(json_response.pluck('id')).to eq(expected_discussion_ids)
+ end
+end