Do not rely on fixtures for login_links as it's not always here.

This commit is contained in:
Remi Jannel 2017-05-19 14:49:33 -04:00
parent 330763aa02
commit 27dca775c7

View File

@ -6,7 +6,15 @@ module Stripe
setup do
account_fixture = API_FIXTURES.fetch(:account)
@account = Stripe::Account.retrieve(account_fixture[:id])
account_fixture = account_fixture.merge(
'login_links' => {
'data' => [],
'has_more' => false,
'object' => 'list',
'url' => "/v1/accounts/#{account_fixture[:id]}/login_links"
}
)
@account = Stripe::Account.construct_from(account_fixture)
end
should "not be retrievable" do
@ -18,6 +26,7 @@ module Stripe
should "be creatable" do
stub_request(:post, "#{Stripe.api_base}/v1/accounts/#{@account.id}/login_links").
to_return(body: JSON.generate(FIXTURE))
login_link = @account.login_links.create
assert_requested :post,
"#{Stripe.api_base}/v1/accounts/#{@account.id}/login_links"