Sha256: 66f3ac4437884b93d4e9f49344edeef4a53f92e2a60ea06fefe6218d7963bbc9

Contents?: true

Size: 764 Bytes

Versions: 21

Compression:

Stored size: 764 Bytes

Contents

require "spec_helper"

describe PagSeguro::DeveloperController do
  let(:file_path) { PagSeguro::DeveloperController::PAGSEGURO_ORDERS_FILE }
  let(:orders) { YAML.load_file(file_path) }

  before do
    File.unlink(file_path) if File.exist?(file_path)
  end

  it "should create file when it doesn't exist" do
    post :create
    File.should be_file(file_path)
  end

  it "should save sent params" do
    post :create, :email_cobranca => "john@doe.com", :ref_transacao => "I1001"
    orders["I1001"]["email_cobranca"].should == "john@doe.com"
    orders["I1001"]["ref_transacao"].should == "I1001"
  end

  it "should redirect to the return url" do
    post :create, :ref_transacao => "I1001"
    response.should redirect_to("/invoices/confirmation")
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
pagseguro-0.1.13 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.12 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.11 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.11.beta2 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.11.beta1 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.10 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.10.beta.0 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.9 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.9.beta.0 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.8 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.7 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.7.beta.1 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.7.beta.0 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.6 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.5 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.4 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.3 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.3.beta.1 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.2 spec/controllers/developer_controller_spec.rb
pagseguro-0.1.1 spec/controllers/developer_controller_spec.rb