Sha256: bb49c7f7ed2f041ac7b72bd184c5feb1857b137ac3f164531eb1f003b170d4fa

Contents?: true

Size: 908 Bytes

Versions: 4

Compression:

Stored size: 908 Bytes

Contents

require 'spec_helper'
require 'mercado_pago_rails/mercado_pago_checkout'
require_relative 'mercado_pago_test_model'

describe MercadoPagoCheckout do

  let(:model) { MercadoPagoTestModel.new }
  subject(:mercado_pago_checkout) { MercadoPagoCheckout.new(model) }

  describe "#generate" do

    context "when the preference wants to be created" do

      it "it returns a hash with the correct data" do
        mercado_pago_checkout.generate("root_url", "root_url", "root_url").should eq get_preference
      end
    end
  end

  def get_preference
    {:external_reference=>1, :items=>[{:id=>"", :title=>"translation missing: en.mercadopago.preference.title", :quantity=>3, :unit_price=>12, :currency_id=>"ARS", :picture_url=>"/test/url"}], :payer=>{:name=>"John", :surname=>"Smith", :email=>"johnsmith@example.com"}, :back_urls=>{:pending=>"root_url", :success=>"root_url", :failure=>"root_url"}}
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mercado_pago_rails-0.1.3 spec/mercado_pago_checkout_spec.rb
mercado_pago_rails-0.1.2 spec/mercado_pago_checkout_spec.rb
mercado_pago_rails-0.1.1 spec/mercado_pago_checkout_spec.rb
mercado_pago_rails-0.1.0 spec/mercado_pago_checkout_spec.rb