Sha256: 0026de4589ca359237890cfdedc5016bcf19cc27b7cf775eabdb837569e314fc

Contents?: true

Size: 817 Bytes

Versions: 5

Compression:

Stored size: 817 Bytes

Contents

describe "Bandeiras e Operacoes" do
  let(:_) { Cieloz::Bandeiras }

  it "recognizes mastercard secure code requires authentication" do
    res = _.operacao "mastercard_securecode"
    assert_equal [_::MASTERCARD, :autorizar_somente_autenticada], res
  end

  it "recognizes verified by visa code requires authentication" do
    res = _.operacao "verified_by_visa"
    assert_equal [_::VISA, :autorizar_somente_autenticada], res
  end

  it "recognizes supported products allows direct authorization" do
    _::ALL.each do |bandeira|
      res = _.operacao bandeira
      assert_equal [bandeira, :autorizacao_direta], res
    end
  end

  it "disallows unsupported products" do
    error = lambda { _.operacao("anything else") }.must_raise RuntimeError
    error.message.must_match /product_not_supported/
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cieloz-0.0.8 test/unit/bandeiras_operacoes_test.rb
cieloz-0.0.7 test/unit/bandeiras_operacoes_test.rb
cieloz-0.0.4 test/unit/bandeiras_operacoes_test.rb
cieloz-0.0.3 test/unit/bandeiras_operacoes_test.rb
cieloz-0.0.2 test/unit/bandeiras_operacoes_test.rb