From 956ba386d684a8788eb3e96aa13fc82480b3f1c5 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Sat, 10 Feb 2024 17:26:57 +0300 Subject: [PATCH] Move system test specific sign in to system test superclass --- test/application_system_test_case.rb | 9 +++++++++ test/test_helper.rb | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index b170e74b1..7931546d4 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -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 diff --git a/test/test_helper.rb b/test/test_helper.rb index e1bc91917..60edf6e0c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -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" } -- 2.45.1