Sha256: c0ba109a2fb0eb2997229bae0bee3dc22ef337ad4d6a809608be9a00f075678a

Contents?: true

Size: 1.02 KB

Versions: 39

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

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

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

39 entries across 39 versions & 1 rubygems

Version Path
stripe-5.31.0 test/stripe/login_link_test.rb
stripe-5.30.0 test/stripe/login_link_test.rb
stripe-5.29.1 test/stripe/login_link_test.rb
stripe-5.29.0 test/stripe/login_link_test.rb
stripe-5.28.0 test/stripe/login_link_test.rb
stripe-5.27.0 test/stripe/login_link_test.rb
stripe-5.26.0 test/stripe/login_link_test.rb
stripe-5.25.0 test/stripe/login_link_test.rb
stripe-5.24.0 test/stripe/login_link_test.rb
stripe-5.23.1 test/stripe/login_link_test.rb
stripe-5.23.0 test/stripe/login_link_test.rb
stripe-5.22.0 test/stripe/login_link_test.rb
stripe-5.21.0 test/stripe/login_link_test.rb
stripe-5.20.0 test/stripe/login_link_test.rb
stripe-5.19.0 test/stripe/login_link_test.rb
stripe-5.18.0 test/stripe/login_link_test.rb
stripe-5.17.0 test/stripe/login_link_test.rb
stripe-5.16.0 test/stripe/login_link_test.rb
stripe-5.15.0 test/stripe/login_link_test.rb
stripe-5.14.0 test/stripe/login_link_test.rb