Skip to content

Commit

Permalink
change #active specs to use WebMock
Browse files Browse the repository at this point in the history
  • Loading branch information
rlivsey committed Jul 21, 2011
1 parent 802054f commit 692ac79
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions spec/subscription_plan_spec.rb
Expand Up @@ -41,18 +41,21 @@
RSpreedly::SubscriptionPlan.all.select{|x| x.is_a?(RSpreedly::SubscriptionPlan )}.size.should == 4
end
end

describe ".active" do
it "should return an empty array if there are no plans at all" do
stub_http_with_fixture("no_plans.xml", 200)
stub_request(:get, spreedly_url("/subscription_plans.xml")).
to_return(:body => fixture("no_plans.xml"), :status => 200)
RSpreedly::SubscriptionPlan.active.should == []
end

it "should return an array of active SubscriptionPlans if there are any to find" do
stub_http_with_fixture("subscription_plan_list.xml", 200)
stub_request(:get, spreedly_url("/subscription_plans.xml")).
to_return(:body => fixture("subscription_plan_list.xml"), :status => 200)

RSpreedly::SubscriptionPlan.active.size.should == 2
RSpreedly::SubscriptionPlan.active.select{|x| x.is_a?(RSpreedly::SubscriptionPlan )}.size.should == 2
end
end

end

0 comments on commit 692ac79

Please sign in to comment.