spec/paymill/credit_card_spec.rb in paymill-0.0.2 vs spec/paymill/credit_card_spec.rb in paymill-0.0.3
- old
+ new
@@ -24,6 +24,27 @@
credit_card.expire_year.should eq(2012)
credit_card.card_holder.should eql("Stefan Sprenger")
credit_card.last4.should eql("1111")
end
end
-end
\ No newline at end of file
+
+ describe ".find" do
+ it "makes a new GET request using the correct API endpoint to receive a specific creditcard" do
+ Paymill.should_receive(:request).with(:get, "creditcards/123", {}).and_return("data" => {})
+ Paymill::CreditCard.find("123")
+ end
+ end
+
+ describe ".all" do
+ it "makes a new GET request using the correct API endpoint to receive all creditcards" do
+ Paymill.should_receive(:request).with(:get, "creditcards/", {}).and_return("data" => {})
+ Paymill::CreditCard.all
+ end
+ end
+
+ describe ".create" do
+ it "makes a new POST request using the correct API endpoint" do
+ Paymill.should_receive(:request).with(:post, "creditcards", valid_attributes).and_return("data" => {})
+ Paymill::CreditCard.create(valid_attributes)
+ end
+ end
+end