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

Patrick J. Collins patrick at collinatorstudios.com
Wed May 9 20:09:04 UTC 2012


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 something like :

it "does stuff" do
  fancy_login_helper_method
  js do
    visit somewhere_over_the_rainbow_path
    click_button "omg"
    page.should have_content("waka waka")
  end
end

So that I can cut down the time it takes to excute that test a bit?  Or
is that just impossible with the way headless vs browser stuff works?

Patrick J. Collins
http://collinatorstudios.com



More information about the rspec-users mailing list