Sha256: 2c40fb71b3c15f75c9769f092047ff71b6662c0d9ee2e87dedfe2a9a75c2c59d

Contents?: true

Size: 1.17 KB

Versions: 22

Compression:

Stored size: 1.17 KB

Contents

require 'test_helper'

class EpsilonConvenienceStoreTest < MiniTest::Test
  def test_blank_parameter_generate_error
    convenience_store = ActiveMerchant::Billing::ConvenienceStore.new(code: "",
                                                                      full_name_kana: "",
                                                                      phone_number: "")
    errors = convenience_store.validate

    assert_includes errors.keys, :code
    assert_includes errors.keys, :full_name_kana
    assert_includes errors.keys, :phone_number

    assert_includes errors[:code], "is required"
    assert_includes errors[:full_name_kana], "is required"
    assert_includes errors[:phone_number], "is required"
  end

  def test_phone_number_only_accept_number
    convenience_store = ActiveMerchant::Billing::ConvenienceStore.new(code: 31,
                                                                      full_name_kana: "ใƒ†ใ‚นใƒˆ",
                                                                      phone_number: "test")

    errors = convenience_store.validate

    assert_includes errors.keys, :phone_number
    assert_includes errors[:phone_number], "is not number"
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
active_merchant-epsilon-0.14.0 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.13.0 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.12.0 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.11.0 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.10.0 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.9.4 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.9.3 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.9.2 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.9.1 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.9.0 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.8.1 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.8.0 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.7.1 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.7.0 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.6.0 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.5.10 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.5.9 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.5.8 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.5.7 test/unit/billing/convenience_store_test.rb
active_merchant-epsilon-0.5.6 test/unit/billing/convenience_store_test.rb