Skip to content

Commit

Permalink
fetch test
Browse files Browse the repository at this point in the history
  • 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.
23 changes: 23 additions & 0 deletions spec/backend_spec.rb
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

0 comments on commit 0197422

Please sign in to comment.