Sha256: 4fa781cec125994a68ef0a29774a65a7bc9df6ae49f917fd35c88114621b69d5

Contents?: true

Size: 946 Bytes

Versions: 9

Compression:

Stored size: 946 Bytes

Contents

require "spec_helper"

describe PagSeguro::Session do
  let(:session) { PagSeguro::Session.new }
  subject { session }

  before do
    PagSeguro.email = 'mail'
    PagSeguro.token = 'token'
  end

  it { should respond_to(:create) }

  describe "#create" do
    subject { session.create  }

    context 'with default email and token' do
      before do
        stub_request(:post, "https://ws.pagseguro.uol.com.br/v2/sessions").
           with(body: "email=mail&token=token").to_return(status: 200)
      end

      it { should be_a_kind_of(PagSeguro::Session::Response) }
    end

    context 'with alternative email and token' do
      subject { session.create('alternative')  }
      before do
        stub_request(:post, "https://ws.pagseguro.uol.com.br/v2/sessions").
           with(body: "email=alt_mail&token=alt_token").to_return(status: 200)
      end

      it { should be_a_kind_of(PagSeguro::Session::Response) }
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pagseguro-transparente-1.1.0 spec/pagseguro/session_spec.rb
pagseguro-transparente-1.0.1 spec/pagseguro/session_spec.rb
pagseguro-transparente-1.0.0 spec/pagseguro/session_spec.rb
pagseguro-transparente-0.2.5 spec/pagseguro/session_spec.rb
pagseguro-transparente-0.2.4 spec/pagseguro/session_spec.rb
pagseguro-transparente-0.2.3 spec/pagseguro/session_spec.rb
pagseguro-transparente-0.2.2 spec/pagseguro/session_spec.rb
pagseguro-transparente-0.2.1 spec/pagseguro/session_spec.rb
pagseguro-transparente-0.2.0 spec/pagseguro/session_spec.rb