summaryrefslogtreecommitdiff
path: root/billing/config/initializers/braintree.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-07-03 12:55:19 +0200
committerAzul <azul@leap.se>2013-07-17 10:47:14 +0200
commite4460bffe2e6a2a4b4edb663332aa57ac17b3370 (patch)
treefc47e214106765bc2937fde58b232dbea1b1ca5f /billing/config/initializers/braintree.rb
parentb51f300fe374e9eecf7e98266c96631fa3c8a278 (diff)
billing: fix integration test
This actually required three little fixes: * couchrest_session_store updated to 0.1.2 to make sure we store sessions * use BraintreeTestApp to proxy braintree requests that RackTest assumes are local * do not attempt to read status after a capybara request Also refactored the test a bit to set @user and login during setup.
Diffstat (limited to 'billing/config/initializers/braintree.rb')
-rw-r--r--billing/config/initializers/braintree.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/billing/config/initializers/braintree.rb b/billing/config/initializers/braintree.rb
index ee21088..523dbce 100644
--- a/billing/config/initializers/braintree.rb
+++ b/billing/config/initializers/braintree.rb
@@ -1,5 +1,11 @@
+require 'braintree_test_app'
+
Braintree::Configuration.logger = Logger.new('log/braintree.log')
Braintree::Configuration.environment = :sandbox
Braintree::Configuration.merchant_id = "bwrdyczvjspmxjhb"
Braintree::Configuration.public_key = "jmw58nbmjg84prbp"
Braintree::Configuration.private_key = "SET_ME"
+
+if Rails.env.test?
+ Rails.application.config.middleware.use BraintreeTestApp
+end