Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Removed deprecation warnings from specs
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrei committed Jul 3, 2018
1 parent 3b5f741 commit 5eec752
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion spec/controllers/api/actions_controller_spec.rb
Expand Up @@ -191,7 +191,7 @@
describe 'successful' do
it 'returns 200' do
put :update, params: { page_id: 2, id: a.id, publish_status: 'published' }
expect(response).to be_success
expect(response).to be_successful
end

it 'changes the status to published' do
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/api/actions_spec.rb
Expand Up @@ -205,7 +205,7 @@
end

it 'responds with success' do
expect(response).to be_success
expect(response).to be_successful
end

it 'does not assign an actionkit_user_id to the created Member' do
Expand Down
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'rails_helper'

describe 'API::Stateless GoCardless PaymentMethods' do
Expand Down Expand Up @@ -100,7 +101,7 @@ def auth_headers
Timecop.freeze do
VCR.use_cassette('stateless api cancel go_cardless mandate') do
delete "/api/stateless/go_cardless/payment_methods/#{delete_me.id}", headers: auth_headers
expect(response.success?).to eq true
expect(response.successful?).to eq true
expect(Payment::GoCardless::PaymentMethod.find(delete_me.id).cancelled_at)
.to be_within(1.second).of Time.now
end
Expand All @@ -123,7 +124,7 @@ def auth_headers
expect(Rails.logger).to receive(:error).with('GoCardlessPro::InvalidApiUsageError occurred when cancelling'\
' mandate nosuchthingongocardless: Resource not found')
delete "/api/stateless/go_cardless/payment_methods/#{i_dont_exist.id}", headers: auth_headers
expect(response.success?).to eq false
expect(response.successful?).to eq false
expect(json_hash['errors']).to eq([{ 'reason' => 'resource_not_found', 'message' => 'Resource not found' }])
expect(Payment::GoCardless::PaymentMethod.find(i_dont_exist.id).cancelled_at).to be nil
end
Expand Down
4 changes: 2 additions & 2 deletions spec/requests/api/stateless/go_cardless/subscriptions_spec.rb
Expand Up @@ -123,7 +123,7 @@ def auth_headers
Timecop.freeze do
VCR.use_cassette('stateless api cancel go_cardless subscription') do
delete "/api/stateless/go_cardless/subscriptions/#{delete_subscription.id}", headers: auth_headers
expect(response.success?).to eq true
expect(response.successful?).to eq true
expect(Payment::GoCardless::Subscription.find(delete_subscription.id).cancelled_at)
.to be_within(1.second).of Time.now
end
Expand All @@ -135,7 +135,7 @@ def auth_headers
expect(Rails.logger).to receive(:error).with('GoCardlessPro::InvalidApiUsageError occurred when cancelling'\
' subscription idontexist: Resource not found')
delete "/api/stateless/go_cardless/subscriptions/#{nonexistent_subscription.id}", headers: auth_headers
expect(response.success?).to eq false
expect(response.successful?).to eq false
expect(json_hash['errors']).to eq([{ 'reason' => 'resource_not_found', 'message' => 'Resource not found' }])
expect(Payment::GoCardless::Subscription.find(nonexistent_subscription.id).cancelled_at).to be nil
end
Expand Down
7 changes: 4 additions & 3 deletions spec/requests/api/survey_responses_spec.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'rails_helper'

describe 'api/pages/:id/survey_responses', type: :request do
Expand All @@ -19,7 +20,7 @@

it 'returns a successful response' do
post "/api/pages/#{page.id}/survey_responses", params: params
expect(response).to be_success
expect(response).to be_successful
end

it 'creates a new action and sets the form data submitted' do
Expand Down Expand Up @@ -97,11 +98,11 @@

it 'updates the existing action' do
post "/api/pages/#{page.id}/survey_responses", params: form_params
expect(response).to be_success
expect(response).to be_successful
@action = Action.last

post "/api/pages/#{page.id}/survey_responses", params: form_2_params
expect(response).to be_success
expect(response).to be_successful

@action.reload
expect(@action.form_data).to include(
Expand Down
3 changes: 2 additions & 1 deletion spec/requests/follow_up_spec.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require 'rails_helper'

describe 'rendering a post action share page' do
Expand All @@ -15,7 +16,7 @@

let(:subject) do
get "/a/#{page.slug}/follow-up"
expect(response.success?).to be true
expect(response.successful?).to be true
end

describe 'a page with no variants' do
Expand Down
10 changes: 5 additions & 5 deletions spec/requests/twilio/calls_spec.rb
Expand Up @@ -8,7 +8,7 @@

it 'returns successfully' do
post "/twilio/calls/#{call.id}/start"
expect(response).to be_success
expect(response).to be_successful
end

it 'sets the call status to started' do
Expand All @@ -28,7 +28,7 @@

it 'returns successfully' do
post "/twilio/calls/#{call.id}/menu"
expect(response).to be_success
expect(response).to be_successful
end
end

Expand All @@ -38,7 +38,7 @@

it 'returns successfully' do
post "/twilio/calls/#{call.id}/connect"
expect(response).to be_success
expect(response).to be_successful
end

it 'sets the call status to connected' do
Expand All @@ -60,7 +60,7 @@
it 'updates call target_call_info' do
post "/twilio/calls/#{call.id}/target_call_status", params: { foo: 'bar' }
expect(call.reload.target_call_info['foo']).to eq('bar')
expect(response).to be_success
expect(response).to be_successful
end

it 'publishes an event' do
Expand All @@ -83,7 +83,7 @@

it 'returns successfully' do
post "/twilio/calls/#{call.id}/member_call_event", params: params
expect(response).to be_success
expect(response).to be_successful
end

it 'updates the call' do
Expand Down

0 comments on commit 5eec752

Please sign in to comment.