Move system test specific sign in to system test superclass

This commit is contained in:
Anton Khorev 2024-02-10 17:26:57 +03:00
parent 56622201d3
commit 956ba386d6
2 changed files with 9 additions and 9 deletions

View file

@ -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

View file

@ -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" }