summaryrefslogtreecommitdiff
path: root/engines/billing
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2017-03-22 08:34:36 +0100
committerAzul <azul@riseup.net>2017-03-22 08:34:36 +0100
commit8c9a7f1c18bea2d54d7a425fc0fab783ce8d275f (patch)
tree63b7e04e3216f0fedd8e9791960f1d4d3a9d5298 /engines/billing
parent2f6273245e178387177db54e82d796e2b7b64525 (diff)
upgrade: bundle
update all the dependencies. minitest now wants assert_nil instead of assert_equal nil, ... braintree now uses update_attributes rather than save.
Diffstat (limited to 'engines/billing')
-rw-r--r--engines/billing/test/functional/subscriptions_controller_test.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/billing/test/functional/subscriptions_controller_test.rb b/engines/billing/test/functional/subscriptions_controller_test.rb
index 1e98eff..592ffc3 100644
--- a/engines/billing/test/functional/subscriptions_controller_test.rb
+++ b/engines/billing/test/functional/subscriptions_controller_test.rb
@@ -53,13 +53,13 @@ class SubscriptionsControllerTest < ActionController::TestCase
test "subscribe creates subscription" do
user = find_record :user
- user.expects(:save).returns(true)
login user
payment_methods = [stub(:token => 'user_token')]
Braintree::Customer.any_instance.stubs(:payment_methods).returns(payment_methods)
- user.expects(:save).returns(true)
+ user.expects(:update_attributes).returns(true).twice
post :subscribe, :id => "1", :first_name => "Test", :last_name => "Testing", :company => "RGSoC", :email => "any@email.com", :phone => "555-888-1234"
+ user.validate
assert assigns(:result).success?
assert_not_nil flash[:success]
@@ -67,12 +67,13 @@ class SubscriptionsControllerTest < ActionController::TestCase
test "unsubscribe cancels subscription" do
user = find_record :user
- user.expects(:save).returns(true)
result = Braintree::Subscription.create(payment_method_token: 'user_token', plan_id: '1')
user.subscription_id = result.subscription.id
login user
+ user.expects(:update_attributes).returns(true)
delete :unsubscribe, :id => "1"
+ user.validate
assert assigns(:result).success?
assert_not_nil flash[:success]