Refine tests

This commit is contained in:
cryptogopher 2024-01-17 05:41:08 +01:00
parent 7cfa3a0af0
commit 651534134e
3 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ mg:
name: milligram name: milligram
multiplier: 0.001 multiplier: 0.001
base: g base: g
g: g_alice:
user: alice user: alice
symbol: g symbol: g
name: gram name: gram

View File

@ -36,7 +36,6 @@ class UnitsTest < ApplicationSystemTestCase
end end
end end
assert_current_path units_path
within('tbody') do within('tbody') do
assert_no_selector :fillable_field assert_no_selector :fillable_field
assert_selector 'tr', count: @user.units.count assert_selector 'tr', count: @user.units.count

View File

@ -84,6 +84,8 @@ class UsersTest < ApplicationSystemTestCase
with: users.reject(&:confirmed?).sample.email with: users.reject(&:confirmed?).sample.email
assert_emails 1 do assert_emails 1 do
click_on t(:resend_confirmation) click_on t(:resend_confirmation)
# Wait until redirected to make sure async request has been processed
assert_current_path new_user_session_path
end end
assert_current_path new_user_session_path assert_current_path new_user_session_path
assert_text t("devise.confirmations.send_instructions") assert_text t("devise.confirmations.send_instructions")
@ -138,8 +140,7 @@ class UsersTest < ApplicationSystemTestCase
end end
test "delete profile" do test "delete profile" do
user = users.select(&:confirmed?).sample user = sign_in
sign_in user: user
# TODO: remove condition after root_url changed to different path than # TODO: remove condition after root_url changed to different path than
# profile in routes.rb # profile in routes.rb
unless has_current_path?(edit_user_registration_path) unless has_current_path?(edit_user_registration_path)