0
0
Fork 0

Services specs for subscribe and unsubscribe (#2928)

* Add specs for unsubscribe service

* Fix non existent methods in unsubscribe service

* Clean up status handling in subscribe service
This commit is contained in:
Matt Jankowski 2017-05-08 18:45:02 -04:00 committed by Eugen Rochko
parent 04166c4a35
commit 5bea42412e
4 changed files with 52 additions and 10 deletions

View file

@ -35,4 +35,9 @@ RSpec.describe SubscribeService do
stub_request(:post, 'http://hub.example.com/').to_return(status: 503)
expect { subject.call(account) }.to raise_error(/Subscription attempt failed/)
end
it 'fails loudly if rate limited' do
stub_request(:post, 'http://hub.example.com/').to_return(status: 429)
expect { subject.call(account) }.to raise_error(/Subscription attempt failed/)
end
end