Sha256: 53933b0dc9f651eb25090825faf86507d3e2f5185753c3be65d3bc951d947cf7

Contents?: true

Size: 1.03 KB

Versions: 36

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require ::File.expand_path("../../test_helper", __FILE__)

module Stripe
  class LoginLinkTest < Test::Unit::TestCase
    setup do
      account_fixture = {
        "id" => "acct_123",
        "object" => "account",
        "login_links" => {
          "data" => [],
          "has_more" => false,
          "object" => "list",
          "url" =>  "/v1/accounts/acct_123/login_links",
        },
      }
      @account = Stripe::Account.construct_from(account_fixture)
    end

    should "not be retrievable" do
      assert_raises NotImplementedError do
        Stripe::LoginLink.retrieve("foo")
      end
    end

    should "be creatable" do
      stub_request(:post, "#{Stripe.api_base}/v1/accounts/#{@account.id}/login_links")
        .to_return(body: JSON.generate(object: "login_link"))

      login_link = @account.login_links.create
      assert_requested :post,
                       "#{Stripe.api_base}/v1/accounts/#{@account.id}/login_links"
      assert login_link.is_a?(Stripe::LoginLink)
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
stripe-4.18.0 test/stripe/login_link_test.rb
stripe-4.17.0 test/stripe/login_link_test.rb
stripe-4.16.0 test/stripe/login_link_test.rb
stripe-4.15.0 test/stripe/login_link_test.rb
stripe-4.14.0 test/stripe/login_link_test.rb
stripe-4.13.0 test/stripe/login_link_test.rb
stripe-4.12.0 test/stripe/login_link_test.rb
stripe-4.11.0 test/stripe/login_link_test.rb
stripe-4.10.0 test/stripe/login_link_test.rb
stripe-4.9.1 test/stripe/login_link_test.rb
stripe-4.9.0 test/stripe/login_link_test.rb
stripe-4.8.1 test/stripe/login_link_test.rb
stripe-4.8.0 test/stripe/login_link_test.rb
stripe-4.7.1 test/stripe/login_link_test.rb
stripe-4.7.0 test/stripe/login_link_test.rb
stripe-4.6.0 test/stripe/login_link_test.rb
stripe-4.5.0 test/stripe/login_link_test.rb
stripe-4.4.1 test/stripe/login_link_test.rb
stripe-4.4.0 test/stripe/login_link_test.rb
stripe-4.3.0 test/stripe/login_link_test.rb