Sha256: ca09f82d9c672a7226a9efa81d27f782d7659794fd961a554415c6485b911b5c

Contents?: true

Size: 1.14 KB

Versions: 5

Compression:

Stored size: 1.14 KB

Contents

require File.dirname(__FILE__) + "/../spec_helper"

describe Braintree::TransparentRedirect do
  it "raises a DownForMaintenanceError when app is in maintenance mode on TR requests" do
    tr_data = Braintree::TransparentRedirect.create_customer_data({:redirect_url => "http://example.com"}.merge({}))
    query_string_response = SpecHelper.simulate_form_post_for_tr(Braintree::Configuration.base_merchant_url + "/test/maintenance", tr_data, {})
    expect do
      Braintree::Customer.create_from_transparent_redirect(query_string_response)
    end.to raise_error(Braintree::DownForMaintenanceError)
  end

  it "raises an AuthenticationError when authentication fails on TR requests" do
    SpecHelper.using_configuration(:private_key => "incorrect") do
      tr_data = Braintree::TransparentRedirect.create_customer_data({:redirect_url => "http://example.com"}.merge({}))
      query_string_response = SpecHelper.simulate_form_post_for_tr(Braintree::Customer.create_customer_url, tr_data, {})
      expect do
        Braintree::Customer.create_from_transparent_redirect(query_string_response)
      end.to raise_error(Braintree::AuthenticationError)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
braintree-2.2.0 spec/integration/braintree/transparent_redirect_spec.rb
braintree-2.1.0 spec/integration/braintree/transparent_redirect_spec.rb
braintree-2.0.0 spec/integration/braintree/transparent_redirect_spec.rb
braintree-1.2.1 spec/integration/braintree/transparent_redirect_spec.rb
braintree-1.2.0 spec/integration/braintree/transparent_redirect_spec.rb