Sha256: 594227c72a70a39b87bcd5114fb7a88866e0546884dfddfab8f074706225e8ae
Contents?: true
Size: 1002 Bytes
Versions: 3
Compression:
Stored size: 1002 Bytes
Contents
require_relative '../spec_helper' describe 'OpenPayResource' do before(:all) do @merchant_id='mywvupjjs9xdnryxtplq' @private_key='sk_92b25d3baec149e6b428d81abfe37006' #LOG.level=Logger::DEBUG @openpay=OpenpayApi.new(@merchant_id,@private_key) @cards=@openpay.create(:cards) end describe '.hash2json' do it 'converts a ruby hash into a json string' do card_hash = FactoryBot.build(:valid_card, holder_name: 'Juan') json=@cards.hash2json(card_hash) expect(json).to have_json_path('holder_name') expect(json).to have_json_path('expiration_year') expect(json).to have_json_path('bank_code') end end describe '.json2hash' do it 'converts json into a ruby hash' do card_hash = FactoryBot.build(:valid_card, holder_name: 'Pepe') json=@cards.hash2json(card_hash) jash=@cards.json2hash(json) expect(jash).to be_a Hash expect(jash['holder_name']).to match 'Pepe' end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
openpay-2.0.1 | test/spec/openpayresource_spec.rb |
openpay-2.0.0 | test/spec/openpayresource_spec.rb |
openpay-2.0.0b | test/spec/openpayresource_spec.rb |