Sha256: b838042f1d0c35be5102d73eec209305645ff49f0533e9f0eec83ec2c072278a

Contents?: true

Size: 1.4 KB

Versions: 2

Compression:

Stored size: 1.4 KB

Contents

require "spec_helper"

describe 'Espago.invoice_items' do

  it "should get info abount invoice_items" do
    VCR.use_cassette('invoice_items get ii_5LS-YR7S1QaJBl3') do
      response = Espago.invoice_items :get,{invoice_item_id:'ii_5LS-YR7S1QaJBl3'}
      response.client.should eq('cli_90Pi6Jf0ndl_PP')
      response.amount.should eq('123.45')
      response.created_at.should eq Time.at(1417030496)
    end
  end

  it "should get info abount invoice_items" do
    VCR.use_cassette('invoice_items post ii_5LS-YR7S1QaJBl3') do
      response = Espago.invoice_items :post,{ amount:49.99,
                                              currency:'pln',
                                              date:'1417126942',
                                              description: 'Test invoice items',
                                              client: 'cli_90Pi6Jf0ndl_PP'
                                            }
      response.status.should eq(201)
      response.client.should eq('cli_90Pi6Jf0ndl_PP')
      response.amount.should eq('49.99')
      response.currency.should eq('pln')
      response.created_at.should eq Time.at(1417102491)
    end
  end

    it "should get info abount deleted invoice_items" do
    VCR.use_cassette('invoice_items delete ii_WDzszvhTshe78Xd') do
      response = Espago.invoice_items :delete,{invoice_item_id:'ii_WDzszvhTshe78Xd'}
      response.status.should eq(204)
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
espago-0.1.8 spec/features/invoice_items_spec.rb
espago-0.1.2 spec/features/invoice_items_spec.rb