diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-18 01:52:17 +0300 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-19 02:04:31 +0300 |
commit | b44a2c801a64fb282cea794871fcfcf81e4ec539 (patch) | |
tree | 32e699b6efa548048abe11f29f84e85e3d2a034f /spec/requests/api/wikis_spec.rb | |
parent | 5d68c23792e87e710877e4baf57605bcf11a6cb5 (diff) |
Update specs to rails5 format
Updates specs to use new rails5 format.
The old format:
`get :show, { some: params }, { some: headers }`
The new format:
`get :show, params: { some: params }, headers: { some: headers }`
Diffstat (limited to 'spec/requests/api/wikis_spec.rb')
-rw-r--r-- | spec/requests/api/wikis_spec.rb | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/spec/requests/api/wikis_spec.rb b/spec/requests/api/wikis_spec.rb index 08bada44178..f5092e8e2b5 100644 --- a/spec/requests/api/wikis_spec.rb +++ b/spec/requests/api/wikis_spec.rb @@ -39,7 +39,7 @@ describe API::Wikis do end it 'returns the list of wiki pages with content' do - get api(url, user), with_content: 1 + get api(url, user), params: { with_content: 1 } expect(response).to have_gitlab_http_status(200) expect(json_response.size).to eq(2) @@ -74,7 +74,7 @@ describe API::Wikis do shared_examples_for 'creates wiki page' do it 'creates the wiki page' do - post(api(url, user), payload) + post(api(url, user), params: payload) expect(response).to have_gitlab_http_status(201) expect(json_response.size).to eq(4) @@ -89,7 +89,7 @@ describe API::Wikis do it "responds with validation error on empty #{part}" do payload.delete(part) - post(api(url, user), payload) + post(api(url, user), params: payload) expect(response).to have_gitlab_http_status(400) expect(json_response.size).to eq(1) @@ -143,7 +143,7 @@ describe API::Wikis do it 'pushes attachment to the wiki repository' do allow(SecureRandom).to receive(:hex).and_return('fixed_hex') - post(api(url, user), payload) + post(api(url, user), params: payload) expect(response).to have_gitlab_http_status(201) expect(json_response).to eq result_hash.deep_stringify_keys @@ -152,7 +152,7 @@ describe API::Wikis do it 'responds with validation error on empty file' do payload.delete(:file) - post(api(url, user), payload) + post(api(url, user), params: payload) expect(response).to have_gitlab_http_status(400) expect(json_response.size).to eq(1) @@ -162,7 +162,7 @@ describe API::Wikis do it 'responds with validation error on invalid temp file' do payload[:file] = { tempfile: '/etc/hosts' } - post(api(url, user), payload) + post(api(url, user), params: payload) expect(response).to have_gitlab_http_status(400) expect(json_response.size).to eq(1) @@ -395,7 +395,7 @@ describe API::Wikis do context 'when user is guest' do before do - post(api(url), payload) + post(api(url), params: payload) end include_examples '404 Project Not Found' @@ -404,7 +404,7 @@ describe API::Wikis do context 'when user is developer' do before do project.add_developer(user) - post(api(url, user), payload) + post(api(url, user), params: payload) end include_examples '403 Forbidden' @@ -413,7 +413,7 @@ describe API::Wikis do context 'when user is maintainer' do before do project.add_maintainer(user) - post(api(url, user), payload) + post(api(url, user), params: payload) end include_examples '403 Forbidden' @@ -425,7 +425,7 @@ describe API::Wikis do context 'when user is guest' do before do - post(api(url), payload) + post(api(url), params: payload) end include_examples '404 Project Not Found' @@ -453,7 +453,7 @@ describe API::Wikis do context 'when user is guest' do before do - post(api(url), payload) + post(api(url), params: payload) end include_examples '404 Project Not Found' @@ -487,7 +487,7 @@ describe API::Wikis do context 'when user is guest' do before do - put(api(url), payload) + put(api(url), params: payload) end include_examples '404 Project Not Found' @@ -497,7 +497,7 @@ describe API::Wikis do before do project.add_developer(user) - put(api(url, user), payload) + put(api(url, user), params: payload) end include_examples '403 Forbidden' @@ -507,7 +507,7 @@ describe API::Wikis do before do project.add_maintainer(user) - put(api(url, user), payload) + put(api(url, user), params: payload) end include_examples '403 Forbidden' @@ -519,7 +519,7 @@ describe API::Wikis do context 'when user is guest' do before do - put(api(url), payload) + put(api(url), params: payload) end include_examples '404 Project Not Found' @@ -529,7 +529,7 @@ describe API::Wikis do before do project.add_developer(user) - put(api(url, user), payload) + put(api(url, user), params: payload) end include_examples 'updates wiki page' @@ -545,7 +545,7 @@ describe API::Wikis do before do project.add_maintainer(user) - put(api(url, user), payload) + put(api(url, user), params: payload) end include_examples 'updates wiki page' @@ -563,7 +563,7 @@ describe API::Wikis do context 'when user is guest' do before do - put(api(url), payload) + put(api(url), params: payload) end include_examples '404 Project Not Found' @@ -573,7 +573,7 @@ describe API::Wikis do before do project.add_developer(user) - put(api(url, user), payload) + put(api(url, user), params: payload) end include_examples 'updates wiki page' @@ -589,7 +589,7 @@ describe API::Wikis do before do project.add_maintainer(user) - put(api(url, user), payload) + put(api(url, user), params: payload) end include_examples 'updates wiki page' @@ -606,7 +606,7 @@ describe API::Wikis do let(:project) { create(:project, :wiki_repo, namespace: group) } before do - put(api(url, user), payload) + put(api(url, user), params: payload) end include_examples 'updates wiki page' @@ -751,7 +751,7 @@ describe API::Wikis do context 'when user is guest' do before do - post(api(url), payload) + post(api(url), params: payload) end include_examples '404 Project Not Found' @@ -760,7 +760,7 @@ describe API::Wikis do context 'when user is developer' do before do project.add_developer(user) - post(api(url, user), payload) + post(api(url, user), params: payload) end include_examples '403 Forbidden' @@ -769,7 +769,7 @@ describe API::Wikis do context 'when user is maintainer' do before do project.add_maintainer(user) - post(api(url, user), payload) + post(api(url, user), params: payload) end include_examples '403 Forbidden' @@ -781,7 +781,7 @@ describe API::Wikis do context 'when user is guest' do before do - post(api(url), payload) + post(api(url), params: payload) end include_examples '404 Project Not Found' @@ -809,7 +809,7 @@ describe API::Wikis do context 'when user is guest' do before do - post(api(url), payload) + post(api(url), params: payload) end include_examples '404 Project Not Found' |