Move system test specific sign in to system test superclass
This commit is contained in:
parent
56622201d3
commit
956ba386d6
2 changed files with 9 additions and 9 deletions
|
@ -24,6 +24,15 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
|||
|
||||
private
|
||||
|
||||
def sign_in_as(user)
|
||||
visit login_path
|
||||
within "form", :text => "Email Address or Username" do
|
||||
fill_in "username", :with => user.email
|
||||
fill_in "password", :with => "test"
|
||||
click_on "Login"
|
||||
end
|
||||
end
|
||||
|
||||
def within_sidebar(&block)
|
||||
within "#sidebar_content", &block
|
||||
end
|
||||
|
|
|
@ -242,15 +242,6 @@ module ActiveSupport
|
|||
end
|
||||
end
|
||||
|
||||
def sign_in_as(user)
|
||||
visit login_path
|
||||
within "form", :text => "Email Address or Username" do
|
||||
fill_in "username", :with => user.email
|
||||
fill_in "password", :with => "test"
|
||||
click_on "Login"
|
||||
end
|
||||
end
|
||||
|
||||
def session_for(user)
|
||||
get login_path
|
||||
post login_path, :params => { :username => user.display_name, :password => "test" }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue