[rspec-users] how can I stub out external service calls during integration tests?

2012-04-18 Thread Patrick J. Collins
Hi, I realize that integration tests are supposed to be high-level and deal with what the user really sees on their end, but say you have a form that integrates via ajax with a payment service like chargify-- Even though that service may have a "sandbox" environment that you can post to, I would

Re: [rspec-users] how can I get prettier failure messages for integration specs?

2012-04-18 Thread Patrick J. Collins
On Thu, 19 Apr 2012, David Chelimsky wrote: > Try this: > > RSpec.configure do |c| >   c.after(:each, :type => :request) do >     save_and_open_page if example.exception >   end > end > > Thank you so much! That works perfectly... Patrick J. Collins http://collinatorstudios.com___

Re: [rspec-users] how can I get prettier failure messages for integration specs?

2012-04-18 Thread David Chelimsky
On Wednesday, April 18, 2012 at 11:30 PM, Patrick J. Collins wrote: > On Wed, 18 Apr 2012, David Chelimsky wrote: > > If you're using capybara you could put save_and_open_page in an after hook. > > You'd still get the console output, but at least you'd see > > the page in a browser. > > > > > I

Re: [rspec-users] how can I get prettier failure messages for integration specs?

2012-04-18 Thread Patrick J. Collins
On Wed, 18 Apr 2012, David Chelimsky wrote: > If you're using capybara you could put save_and_open_page in an after hook. > You'd still get the console output, but at least you'd see > the page in a browser. Is there a way to make that happen only upon failures during integration tests? Patrick

Re: [rspec-users] how can I get prettier failure messages for integration specs?

2012-04-18 Thread David Chelimsky
On Wednesday, April 18, 2012 at 7:01 PM, Patrick J. Collins wrote: > When an integration test fails, I get a whole mess of garbage that is > all in red, very painful to the eyes-- Especially when I quickly just > want to see what went wrong-- in this case, all I want to see is > ActiveRecord::Recon

Re: [rspec-users] One error reported recursively if two pages visited by request spec

2012-04-18 Thread David Chelimsky
On Wednesday, April 18, 2012 at 4:30 PM, Mark Berry wrote: > > On Wed April 18, 2012 at 5:35 AM, David Chelimsky wrote: > > On Tuesday, April 17, 2012 at 11:11 PM, Mark Berry wrote: > > > Hi, > > > > > > I'm using Rails 3.1.3, rspec-rails 2.9.0, and Ruby 1.9.3p0. > > > > > > I've been getting rec

[rspec-users] how can I get prettier failure messages for integration specs?

2012-04-18 Thread Patrick J. Collins
When an integration test fails, I get a whole mess of garbage that is all in red, very painful to the eyes-- Especially when I quickly just want to see what went wrong-- in this case, all I want to see is ActiveRecord::RecondNotFound-- but instead I see: Failure/Error: page.should have_content

Re: [rspec-users] rspec-users Digest, Vol 70, Issue 13

2012-04-18 Thread Nasir Jamal
vid [1] https://github.com/rspec/rspec-rails/issues/391 -- next part -- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120418/f6a086f2/attachment-0001.html>___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] One error reported recursively if two pages visited by request spec

2012-04-18 Thread Mark Berry
>On Wed April 18, 2012 at 5:35 AM, David Chelimsky wrote: >On Tuesday, April 17, 2012 at 11:11 PM, Mark Berry wrote: >> Hi, >> >> I'm using Rails 3.1.3, rspec-rails 2.9.0, and Ruby 1.9.3p0. >> >> I've been getting recursive errors, where one error is reported >> multiple times. It's quite spectacu

[rspec-users] Testing parameter passed to controller new method (undefined method 'stringify_keys')

2012-04-18 Thread Justin Funk
I'm trying to test passing a parameter to the new method of my controller and am coming up with the "undefined method 'stringify_keys'" error when I use this code: get "new", { :company_id => '1' } I have seen other solutions to this issue, but they have all centered around the create method and

Re: [rspec-users] Access controller object in controller macro

2012-04-18 Thread David Chelimsky
On Tuesday, April 17, 2012 at 2:30 PM, Nasir Jamal wrote: > > Hi > > We have just upgraded our Rails 2.3.11 app to Rails 3.0.0 and Rspec 1.3.2 to > 2.6. We are having two problems with rspec currently and any help would be > great. > > 1) We have some controller macros where we have been using

Re: [rspec-users] One error reported recursively if two pages visited by request spec

2012-04-18 Thread David Chelimsky
On Tuesday, April 17, 2012 at 11:11 PM, Mark Berry wrote: > Hi, > > I'm using Rails 3.1.3, rspec-rails 2.9.0, and Ruby 1.9.3p0. > > I've been getting recursive errors, where one error is reported > multiple times. It's quite spectacular in a long suite, with the > errors overflowing the console b

Re: [rspec-users] Access controller object in controller macro

2012-04-18 Thread Nasir Jamal
Hi Justin Yes, the specs are in app_root/spec/controllers/ and we running the specs from app_root. We are including the macros like so: RSpec.configure do |config|     config.include(ControllerMacros, :type => :controller) end Kind regards, Nas From: Justin

Re: [rspec-users] Access controller object in controller macro

2012-04-18 Thread Justin Ko
On Apr 17, 2012, at 1:30 PM, Nasir Jamal wrote: > > Hi > > We have just upgraded our Rails 2.3.11 app to Rails 3.0.0 and Rspec 1.3.2 to > 2.6. We are having two problems with rspec currently and any help would be > great. > > 1) We have some controller macros where we have been using the con