similar to: Mock objects for stubbing out Paypal - anyone have any???

Displaying 20 results from an estimated 10000 matches similar to: "Mock objects for stubbing out Paypal - anyone have any???"

2007 Feb 05
1
Mock objects for stubbing out Paypal - anyone have any???
Hi, Just wondering if anyone has already developed a mocking approach to stub out the Paypal interface so that one can test on an internal PC which doesn''t provide a means for PayPal to callback to your webserver? (i.e. once the app is deployed to the hosting provider it would then work as PayPal could then hit the application with the specified URL). Anyone already solved this? Would
2007 Feb 05
10
how does Mocha compare in terms of classical vs mock-based testing, and stubbing???
Hi guys, I''ve just been reading Martin Fowler''s article re mock versus stubbing<http://martinfowler.com/articles/mocksArentStubs.html>where he compares traditional TDD testing techniques with mock based testing. I''d be interested in comments from a ruby on rails perspective in terms of this and Mocha? For example: a) Do you see Mocha as a robust way to test Ruby
2006 Oct 13
6
If I stub do I have to mock as well?
Hi, I''m new to mocha and stubba but eager to learn. I have a rails functional test in which I would like to stub an instance method of particular class to always return true. I tried the following: def test_post_checkout Order.any_instance.stubs(:successful?).returns(true) post :checkout assert_response :redirect assert_equal "Checkout was successful.",
2007 Nov 11
1
Paypal Library - How to stop payments going to sandbox
I am using the Paypal Library for ruby (http://dist.leetsoft.com/api/paypal/) I have been testing it in development mode and the paypal sandbox site. Now I have moved my application into production mode but the paypal url still goes to the sandbox site: https://www.sandbox.paypal.com/cgi-bin/webscr How do I change the paypal URL? -- Posted via http://www.ruby-forum.com/.
2007 Mar 05
4
When to stub/when to mock (was Rails functional testing and Mocha)
Hi James, > From: James Mead <jamesmead44 at gmail.com> > Date: Mar 5, 2007 5:15 AM > Subject: Re: [mocha-developer] Rails functional testing and Mocha > To: mocha-developer at rubyforge.org > "I''d probably stub the call to find not expect it, because its a query not a command" I have a different perspective on when to use stubs and when to use mocks and
2006 Nov 21
5
stubbing in development environment
Hi guys. Quite happy with mocha for testing. It''s been a bit of an eye opener for me, and I expect to begin using it heavily. One other thing I''d like to do is stub out particular class methods in development. Is there a way I can do this with mocha? Jason
2007 Sep 21
5
Stubbing yielding methods
I''ve just been tying my brain in knots looking at bug #8687 ( http://rubyforge.org/tracker/index.php?func=detail&aid=8687&group_id=1917&atid=7477 ). I''ve been (1) trying to work out whether there is anything logically wrong with Mocha''s existing behaviour and (2) whether Mocha should support the requested functionality. It all centres around the use of the
2006 Dec 21
4
Stubbing Kernel#open
Anyone know how to stub Kernel#open? I''m trying to mock/stub an open-uri call, but it doesn''t seem to like it. Here''s the test code, and the failures: body = File.open(File.dirname(__FILE__) + ''/../fixtures/google_search_california.html'').read
2006 Jun 26
6
paypal ipn from leetsoft
Has anyone had any luck with the paypal gem from leetsoft (Tobias Luetke)? I''m successfully sending off and making payments, but the ipn doesn''t send back to my site. I have the notify_url set in the form, have a action set for the ipn postbacks, but all I get from my sandbox after payment is a "view shops" page from paypal after payment is made. -- Posted via
2007 May 27
2
Mocking Requests
Hi Guys! I just joined this list after James helped me out in ruby-talk to mock a http get request for a project I have running :) Now comes the second question... I was fiddling around, making the mocking with the get request work (which turned out to me pretty easy), but then I ran into another problem. I was faced with mocking the post request, so I thought I could do it the same way
2006 Feb 07
21
Paypal and Rails
Hello everyone, I am looking for a way to pass off a simple payment to paypal using our own interface. I understand that this requires making full use of Paypal''s API since we won''t be using their shopping cart or anything. I found the article by Pranav Bihari on his site and in the Wiki on using SOAP4R and the paypal WSDL file to interface with paypal web services, but I
2006 Apr 21
10
Paypal payments and IPN
I have followed the instructions over at http://dist.leetsoft.com/api/paypal/ In order I: 1. installed the money library with gem install --source http://dist.leetsoft.com/api/paypal/ money 2. installed the paypal library with gem install --source http://dist.leetsoft.com/api/paypal/ paypal 3. created a new app with rails NewApp 4. added the PaymentHelper module to the
2007 Nov 04
3
Returning the mock associated with an expectation.
I was reading through the FlexMock docs and noticed the expectation method .mock, which returns the original mock associated with an expectation. It looks really handy for writing nice all-in-one mocks like: mock_user = mock(''User'').expects(:first_name).returns(''Jonah'').mock So I started playing around with mocha and found I could actually already do this!
2006 Feb 10
2
Paypal and subscriptions
Does anyone have any experience with subscriptions and PayPal? I''m currently weighing up the options of what payment system to use for an upcoming project which is subscription based and am not sure if PayPal is capable of doing what I want and if I need to setup a merchant account instead. Basically it''s the same kind of payment structure as BaseCamp. 3 or 4 accounts which
2008 Jun 12
1
Does anyone know how to mock the Rails Logger then set expectations with should_receive?
Hey Guys, I''m trying to mock the Rails Logger for the following code: ... rescue TimeoutError => error $logger.error("#{self.name} Timeout for #{path}: #{error}") and return rescue SocketError => error $logger.error("#{self.name} SocketError for #{path}: #{error}") and return rescue StandardError => error
2006 Jul 26
0
Has anyone managed to get the Paypal plugin to work?
Is there anyone out there who has managed to get Paypal immediate payment notificiations to work with the Paypal plugin? I can get as far as making the payment in the sandbox, but can''t get any acknowledgement back to confirm the payment was made. I''m confised as to how Paypal will know where to send the acknowledgement as I''ve not supplied my IP address or anything
2006 Apr 22
0
available: lib for Paypal''s Payment data transfer
Hi, following the discussion about Paypal''s IPN usage with leetsoft''s paypal library, I''ve posted an addition to that library so you can use Paypal''s Payment Data Transfer. It''s largely inspired by, with some chinks even simply copied from, the IPN code. Downloadable at http://www.myowndb.com/files/payment_data.rb I blogged about it at
2007 Oct 25
1
Mocking/Stubbing help with subdomain as account key
My app uses account_location to set up subdomains as account keys. In my controllers, all my model operations are scoped through the @current_person object. The question is: How do I test this with RSpec''s mocking and stubbing? Basically, I need to test that @current_person.things is getting the find message and returning @thing. I''ve tried stubbing and mocking
2007 Aug 21
7
mocking singletons
How can I safely mock a singleton without the mocked method living on outside the scope of the test method? I''ve run into this problem with mocking methods on globals (gasp!) in the past by doing something like def mock_my_global original = $my_global $my_global.expects(:foo).returns(''bar'') yield $my_global = original end Is there something similar I
2006 Aug 01
0
Paypal and Rails (Site down?)
I''m having trouble getting the paypal/rails stuff from this site : http://dist.leetsoft.com/api/paypal/ Is this site down or is there a mirror? Also does anyone know of any good RoR paypal guides/tutorials? Thanks, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: