spec/unit/braintree/configuration_spec.rb in braintree-2.10.2 vs spec/unit/braintree/configuration_spec.rb in braintree-2.10.3
- old
+ new
@@ -9,13 +9,14 @@
@original_environment = Braintree::Configuration.environment
end
after do
Braintree::Configuration.merchant_id = @original_merchant_id
- Braintree::Configuration.public_key = @original_public_key
+ Braintree::Configuration.public_key = @original_public_key
Braintree::Configuration.private_key = @original_private_key
Braintree::Configuration.environment = @original_environment
+ Braintree::Configuration.endpoint = Braintree::Configuration::DEFAULT_ENDPOINT
end
describe "base_merchant_path" do
it "returns /merchants/{merchant_id}" do
Braintree::Configuration.instantiate.base_merchant_path.should == "/merchants/integration_merchant_id"
@@ -178,11 +179,11 @@
Braintree::Configuration.instantiate.protocol.should == "https"
end
end
- describe "self.server" do
+ describe "server" do
it "is localhost for development" do
Braintree::Configuration.environment = :development
Braintree::Configuration.instantiate.server.should == "localhost"
end
@@ -192,9 +193,15 @@
end
it "is sandbox.braintreegateway.com for sandbox" do
Braintree::Configuration.environment = :sandbox
Braintree::Configuration.instantiate.server.should == "sandbox.braintreegateway.com"
+ end
+
+ it "can by changed by configuring the production endpoint" do
+ Braintree::Configuration.environment = :production
+ Braintree::Configuration.endpoint = "custom-endpoint"
+ Braintree::Configuration.instantiate.server.should == "custom-endpoint.braintreegateway.com"
end
end
describe "ssl?" do
it "returns false for development" do