Sha256: ef659749150c67e3316aa6c36965cd63f2f8c5613438fa406a5e80e46744e8b9

Contents?: true

Size: 1.69 KB

Versions: 15

Compression:

Stored size: 1.69 KB

Contents

# frozen_string_literal: true

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

module Stripe
  module Radar
    class ValueListTest < Test::Unit::TestCase
      should "be listable" do
        lists = Stripe::Radar::ValueList.list
        assert_requested :get, "#{Stripe.api_base}/v1/radar/value_lists"
        assert lists.data.is_a?(Array)
        assert lists.first.is_a?(Stripe::Radar::ValueList)
      end

      should "be retrievable" do
        list = Stripe::Radar::ValueList.retrieve("rsl_123")
        assert_requested :get, "#{Stripe.api_base}/v1/radar/value_lists/rsl_123"
        assert list.is_a?(Stripe::Radar::ValueList)
      end

      should "be creatable" do
        list = Stripe::Radar::ValueList.create(
          alias: "list_alias",
          name: "list_name"
        )
        assert_requested :post, "#{Stripe.api_base}/v1/radar/value_lists"
        assert list.is_a?(Stripe::Radar::ValueList)
      end

      should "be saveable" do
        list = Stripe::Radar::ValueList.retrieve("rsl_123")
        list.metadata["key"] = "value"
        list.save
        assert_requested :post, "#{Stripe.api_base}/v1/radar/value_lists/rsl_123"
      end

      should "be updateable" do
        list = Stripe::Radar::ValueList.update("rsl_123", metadata: { key: "value" })
        assert_requested :post, "#{Stripe.api_base}/v1/radar/value_lists/rsl_123"
        assert list.is_a?(Stripe::Radar::ValueList)
      end

      should "be deletable" do
        list = Stripe::Radar::ValueList.retrieve("rsl_123")
        list = list.delete
        assert_requested :delete, "#{Stripe.api_base}/v1/radar/value_lists/rsl_123"
        assert list.is_a?(Stripe::Radar::ValueList)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
stripe-4.11.0 test/stripe/radar/value_list_test.rb
stripe-4.10.0 test/stripe/radar/value_list_test.rb
stripe-4.9.1 test/stripe/radar/value_list_test.rb
stripe-4.9.0 test/stripe/radar/value_list_test.rb
stripe-4.8.1 test/stripe/radar/value_list_test.rb
stripe-4.8.0 test/stripe/radar/value_list_test.rb
stripe-4.7.1 test/stripe/radar/value_list_test.rb
stripe-4.7.0 test/stripe/radar/value_list_test.rb
stripe-4.6.0 test/stripe/radar/value_list_test.rb
stripe-4.5.0 test/stripe/radar/value_list_test.rb
stripe-4.4.1 test/stripe/radar/value_list_test.rb
stripe-4.4.0 test/stripe/radar/value_list_test.rb
stripe-4.3.0 test/stripe/radar/value_list_test.rb
stripe-4.2.0 test/stripe/radar/value_list_test.rb
stripe-4.1.0 test/stripe/radar/value_list_test.rb