-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Manuel van Rijn
committed
Feb 16, 2012
1 parent
685a253
commit 0197422
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require 'spec_helper' | ||
|
||
describe "backend" do | ||
it "should return the Mollie Bank when requesting /xml/ideal?a=banklist" do | ||
post '/xml/ideal?a=banklist' | ||
last_response.should be_ok | ||
xml = Nokogiri::Slop(last_response.body) | ||
|
||
xml.response.bank.bank_id.content.should == "0001" | ||
xml.response.bank.bank_name.content.should == "Mollie Bank" | ||
end | ||
it "should return the correct xml for /xml/ideal?a=fetch" do | ||
post '/xml/ideal?a=fetch&partnerid=1234&description=a&reporturl=http://test.com/report&returnurl=http://test.com/returnurl&amount=1000&bank_id=0001' | ||
puts last_response.body | ||
xml = Nokogiri::Slop(last_response.body) | ||
|
||
xml.response.order.transaction_id.content.should_not be_blank | ||
xml.response.order.amount.content.should == "1000" | ||
xml.response.order.currency.content.should == "EUR" | ||
xml.response.order.URL.content.should contain "http://example.org/ideal?transaction_id=" | ||
xml.response.order.message.content.should == "Your iDEAL-payment has successfully been setup. Your customer should visit the given URL to make the payment" | ||
end | ||
end |