Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.65 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. module Spec
  2.   module IntegrationHelpers
  3.     # Signs the user in by filling up the form.
  4.     def sign_user_in_manually(user=Factory(:user))
  5.       visit new_user_session_path
  6.  
  7.       fill_in "Email", :with => user.email
  8.       fill_in "Senha", :with => user.password
  9.       click_button "Entrar"
  10.  
  11.       page.should have_content("VocĂȘ acessou o site com sucesso.")
  12.       user
  13.     end
  14.  
  15.     # Does exists a link poining to this href and the defined options?
  16.     def have_link_to(url, options={})
  17.       have_css("a[href='%s']" % url, options)
  18.     end
  19.  
  20.     def should_be_on(path)
  21.       URI.parse(current_url).path.should == path
  22.     end
  23.   end
  24. end