Sha256: 47338e70fbb724ebe633b86d839b05b8c094a02308d1596d4b27b43fa165f9a4

Contents?: true

Size: 921 Bytes

Versions: 5

Compression:

Stored size: 921 Bytes

Contents

# -*- encoding: utf-8 -*-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Sender" do
  
  let(:xml)         { File.open(File.expand_path(File.dirname(__FILE__) + '/../support/return.xml')).read }
  let(:transaction) { PagseguroCatcher::Transaction::Base.new(xml) }
  let(:sender)      { PagseguroCatcher::Transaction::Sender.new(transaction.body) }
  
  describe ".initialize" do
    it "assigns the body" do
      sender.body.should be_a(Hash)
    end
  end
  
  describe "#name" do
    it "returns the senders name" do
      sender.name.should eql "José Comprador"
    end
  end

  describe "#email" do
    it "returns the senders email" do
      sender.email.should eql "comprador@uol.com.br"
    end
  end
  
  describe "#phone" do
    it "returns the senders phone" do
      phone = sender.phone
      phone.should == { :area => "11", :number => "56273440" }
    end
  end
  
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pagseguro_catcher-0.1.3 spec/transaction/sender_spec.rb
pagseguro_catcher-0.1.2 spec/transaction/sender_spec.rb
pagseguro_catcher-0.1.1 spec/transaction/sender_spec.rb
pagseguro_catcher-0.1.0 spec/transaction/sender_spec.rb
pagseguro_catcher-0.0.4 spec/transaction/sender_spec.rb