Permalink
Browse files

fetch test

  • Loading branch information...
1 parent 685a253 commit 019742247d02a4aa3144693c507aa6df674c546e Manuel van Rijn committed Feb 16, 2012
Showing with 23 additions and 0 deletions.
  1. +23 −0 spec/backend_spec.rb
View
@@ -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

0 comments on commit 0197422

Please sign in to comment.