[rspec-users] stub.as_null_object mock and double

2012-05-09 Thread Andrew Premdas
Hi there, Is there any particular reason why stub is not stub.as_null_object by default? Or alternatively is there some nicer sugar for stub.as_null_object Is RSpec trying to discourage the use of stub.as_null_object, and if so why? TIA Andrew -- Andrew Premdas blog.

Re: [rspec-users] stub.as_null_object mock and double

2012-05-09 Thread David Chelimsky
On Wed, May 9, 2012 at 11:01 AM, Andrew Premdas wrote: > Hi there, > > Is there any particular reason why stub is not stub.as_null_object by > default? See https://github.com/rspec/rspec-mocks/issues/56 ___ rspec-users mailing list rspec-users@rubyforge

[rspec-users] is there a way to turn on :js => true in the middle of a spec?

2012-05-09 Thread Patrick J. Collins
Hi, If I have a spec with some complicated background stuff-- like say for example logging in... it "does stuff", :js => true do fancy_login_helper_method visit somewhere_over_the_rainbow_path click_button "omg" page.should have_content("waka waka") end ... Is there any way to do somet

Re: [rspec-users] is there a way to turn on :js => true in the middle of a spec?

2012-05-09 Thread David Chelimsky
On Wed, May 9, 2012 at 3:09 PM, Patrick J. Collins wrote: > Hi, > > If I have a spec with some complicated background stuff--  like say for > example logging in... > > it "does stuff", :js => true do >  fancy_login_helper_method >  visit somewhere_over_the_rainbow_path >  click_button "omg" >  pag

[rspec-users] how do I test for a status code in a :js => true test?

2012-05-09 Thread Patrick J. Collins
I have a view with some javascript that does page redirection, and I wanted to confirm that under certain circumstances the user will get a 500 error from CanCan::AccessDenied. It seems that when I am not using :js => true, I can do: page.status_code.shoud be 500 but.. when I try that in a :js =