Permalink
Browse files

Added Subscription#past_due?

  • Loading branch information...
1 parent bfc9578 commit d78330dad27f517a940e41d2bbe7be53cf2eedfb @jferris jferris committed Dec 7, 2011
Showing with 12 additions and 0 deletions.
  1. +4 −0 lib/ashmont/subscription.rb
  2. +8 −0 spec/ashmont/subscription_spec.rb
View
4 lib/ashmont/subscription.rb
@@ -53,6 +53,10 @@ def reload
self
end
+ def past_due?
+ status == Braintree::Subscription::Status::PastDue
+ end
+
private
def remote_status
View
8 spec/ashmont/subscription_spec.rb
@@ -171,6 +171,14 @@
subscription.status.should == "active"
end
+ it "is past due with a past due status" do
+ Ashmont::Subscription.new("xyz", :status => Braintree::Subscription::Status::PastDue).should be_past_due
+ end
+
+ it "isn't past due with an active status" do
+ Ashmont::Subscription.new("xyz", :status => Braintree::Subscription::Status::Active).should_not be_past_due
+ end
+
def with_configured_merchant_acount_id
merchant_account_id = "jkl"
Ashmont.merchant_account_id = merchant_account_id

0 comments on commit d78330d

Please sign in to comment.