forked from fixin.me/fixin.me
Fix tests after routing/locale changes
This commit is contained in:
parent
af152c5e8b
commit
d250119601
@ -47,7 +47,7 @@ class UsersTest < ApplicationSystemTestCase
|
|||||||
assert_emails 1 do
|
assert_emails 1 do
|
||||||
click_on t("users.passwords.edit.update_password")
|
click_on t("users.passwords.edit.update_password")
|
||||||
# Wait until redirected to make sure async request has been processed
|
# Wait until redirected to make sure async request has been processed
|
||||||
assert_current_path /#{users_path}|#{edit_user_registration_path}/
|
assert_current_path units_path
|
||||||
end
|
end
|
||||||
assert_text t("devise.passwords.updated")
|
assert_text t("devise.passwords.updated")
|
||||||
end
|
end
|
||||||
@ -99,7 +99,7 @@ class UsersTest < ApplicationSystemTestCase
|
|||||||
|
|
||||||
test "show profile" do
|
test "show profile" do
|
||||||
sign_in user: users.select(&:admin?).select(&:confirmed?).sample
|
sign_in user: users.select(&:admin?).select(&:confirmed?).sample
|
||||||
click_on t("layouts.application.users")
|
click_on t("users.navigation")
|
||||||
within all('tr').drop(1).sample do |tr|
|
within all('tr').drop(1).sample do |tr|
|
||||||
email = first(:link).text
|
email = first(:link).text
|
||||||
click_on email
|
click_on email
|
||||||
@ -111,11 +111,12 @@ class UsersTest < ApplicationSystemTestCase
|
|||||||
user = users.select(&:admin?).select(&:confirmed?).sample
|
user = users.select(&:admin?).select(&:confirmed?).sample
|
||||||
sign_in user: user
|
sign_in user: user
|
||||||
|
|
||||||
click_on t("layouts.application.users")
|
click_on t("users.navigation")
|
||||||
all(:link_or_button, text: t("users.index.disguise")).sample.click
|
link = all(:link_or_button, text: t("users.index.disguise")).sample
|
||||||
assert_current_path edit_user_registration_path
|
email = link.ancestor('tr').first(:link)[:text]
|
||||||
# TODO: test for "Profile" link button after root_url changed to different
|
link.click
|
||||||
# path then profile in routes.rb
|
assert_current_path units_path
|
||||||
|
assert_link email
|
||||||
|
|
||||||
click_on t("layouts.application.revert")
|
click_on t("layouts.application.revert")
|
||||||
assert_current_path users_path
|
assert_current_path users_path
|
||||||
@ -126,7 +127,7 @@ class UsersTest < ApplicationSystemTestCase
|
|||||||
user = users.select(&:admin?).select(&:confirmed?).sample
|
user = users.select(&:admin?).select(&:confirmed?).sample
|
||||||
sign_in user: user
|
sign_in user: user
|
||||||
|
|
||||||
click_on t("layouts.application.users")
|
click_on t("users.navigation")
|
||||||
text = t("users.index.disguise")
|
text = t("users.index.disguise")
|
||||||
# Pick row without 'disguise' button
|
# Pick row without 'disguise' button
|
||||||
undisguisable = all(:xpath, "//tbody//tr[not(descendant::*[contains(text(),\"#{text}\")])]")
|
undisguisable = all(:xpath, "//tbody//tr[not(descendant::*[contains(text(),\"#{text}\")])]")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user