Created
December 19, 2011 21:22
-
-
Save PrototypeAlex/1498938 to your computer and use it in GitHub Desktop.
Redirect_to problem
This file contains hidden or 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
// LockerController | |
def make_payment | |
@locker = Locker.find(params[:id]) | |
respond_to do |format| | |
if !@locker || @locker.user | |
format.html { redirect_to user_lockers_url, notice: "Opps, something went wrong, please try again" } | |
else | |
reply = Nestful.post PXPAYURL, :format => :xml, :body => generate_request_xml(@locker).target! | |
if reply['valid'].to_i == 1 | |
format.html { redirect_to reply['URI'] } | |
else | |
raise reply.inspect | |
end | |
end | |
end | |
end | |
// And the integration test | |
describe 'GET make_payment' do | |
it 'should be able to redirect to the DPS hosted site' do | |
locker = Locker.make! | |
visit user_make_payment_url(locker.id) | |
page.should have_button('Purchase a New Locker') | |
end | |
end | |
Failure/Error: click_link('YES') | |
ActionController::RoutingError: | |
No route matches [GET] "/pxpay/pxpay.aspx" | |
# (eval):2:in `click_link' | |
# ./spec/requests/user/user_lockers_spec.rb:89:in `block (3 levels) in <top (required)>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment