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/broadcast_messages_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/broadcast_messages_spec.rb')
-rw-r--r-- | spec/requests/api/broadcast_messages_spec.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/requests/api/broadcast_messages_spec.rb b/spec/requests/api/broadcast_messages_spec.rb index fe8a14fae9e..0b48b79219c 100644 --- a/spec/requests/api/broadcast_messages_spec.rb +++ b/spec/requests/api/broadcast_messages_spec.rb @@ -56,13 +56,13 @@ describe API::BroadcastMessages do describe 'POST /broadcast_messages' do it 'returns a 401 for anonymous users' do - post api('/broadcast_messages'), attributes_for(:broadcast_message) + post api('/broadcast_messages'), params: attributes_for(:broadcast_message) expect(response).to have_gitlab_http_status(401) end it 'returns a 403 for users' do - post api('/broadcast_messages', user), attributes_for(:broadcast_message) + post api('/broadcast_messages', user), params: attributes_for(:broadcast_message) expect(response).to have_gitlab_http_status(403) end @@ -72,7 +72,7 @@ describe API::BroadcastMessages do attrs = attributes_for(:broadcast_message) attrs.delete(:message) - post api('/broadcast_messages', admin), attrs + post api('/broadcast_messages', admin), params: attrs expect(response).to have_gitlab_http_status(400) expect(json_response['error']).to eq 'message is missing' @@ -81,7 +81,7 @@ describe API::BroadcastMessages do it 'defines sane default start and end times' do time = Time.zone.parse('2016-07-02 10:11:12') travel_to(time) do - post api('/broadcast_messages', admin), message: 'Test message' + post api('/broadcast_messages', admin), params: { message: 'Test message' } expect(response).to have_gitlab_http_status(201) expect(json_response['starts_at']).to eq '2016-07-02T10:11:12.000Z' @@ -92,7 +92,7 @@ describe API::BroadcastMessages do it 'accepts a custom background and foreground color' do attrs = attributes_for(:broadcast_message, color: '#000000', font: '#cecece') - post api('/broadcast_messages', admin), attrs + post api('/broadcast_messages', admin), params: attrs expect(response).to have_gitlab_http_status(201) expect(json_response['color']).to eq attrs[:color] @@ -104,14 +104,14 @@ describe API::BroadcastMessages do describe 'PUT /broadcast_messages/:id' do it 'returns a 401 for anonymous users' do put api("/broadcast_messages/#{message.id}"), - attributes_for(:broadcast_message) + params: attributes_for(:broadcast_message) expect(response).to have_gitlab_http_status(401) end it 'returns a 403 for users' do put api("/broadcast_messages/#{message.id}", user), - attributes_for(:broadcast_message) + params: attributes_for(:broadcast_message) expect(response).to have_gitlab_http_status(403) end @@ -120,7 +120,7 @@ describe API::BroadcastMessages do it 'accepts new background and foreground colors' do attrs = { color: '#000000', font: '#cecece' } - put api("/broadcast_messages/#{message.id}", admin), attrs + put api("/broadcast_messages/#{message.id}", admin), params: attrs expect(response).to have_gitlab_http_status(200) expect(json_response['color']).to eq attrs[:color] @@ -132,7 +132,7 @@ describe API::BroadcastMessages do travel_to(time) do attrs = { starts_at: Time.zone.now, ends_at: 3.hours.from_now } - put api("/broadcast_messages/#{message.id}", admin), attrs + put api("/broadcast_messages/#{message.id}", admin), params: attrs expect(response).to have_gitlab_http_status(200) expect(json_response['starts_at']).to eq '2016-07-02T10:11:12.000Z' @@ -143,7 +143,7 @@ describe API::BroadcastMessages do it 'accepts a new message' do attrs = { message: 'new message' } - put api("/broadcast_messages/#{message.id}", admin), attrs + put api("/broadcast_messages/#{message.id}", admin), params: attrs expect(response).to have_gitlab_http_status(200) expect { message.reload }.to change { message.message }.to('new message') @@ -154,14 +154,14 @@ describe API::BroadcastMessages do describe 'DELETE /broadcast_messages/:id' do it 'returns a 401 for anonymous users' do delete api("/broadcast_messages/#{message.id}"), - attributes_for(:broadcast_message) + params: attributes_for(:broadcast_message) expect(response).to have_gitlab_http_status(401) end it 'returns a 403 for users' do delete api("/broadcast_messages/#{message.id}", user), - attributes_for(:broadcast_message) + params: attributes_for(:broadcast_message) expect(response).to have_gitlab_http_status(403) end |