mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Refactoring tests with I18n.
This commit is contained in:
parent
40aaa98de9
commit
fc89db636a
2 changed files with 6 additions and 13 deletions
|
@ -102,17 +102,14 @@ class AuthenticationTest < ActionController::IntegrationTest
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'error message is configurable by resource name' do
|
test 'error message is configurable by resource name' do
|
||||||
begin
|
store_translations :en, :devise => {
|
||||||
I18n.backend.store_translations(:en, :devise => { :sessions =>
|
:sessions => { :admin => { :invalid => "Invalid credentials" } }
|
||||||
{ :admin => { :invalid => "Invalid credentials" } } })
|
} do
|
||||||
|
|
||||||
sign_in_as_admin do
|
sign_in_as_admin do
|
||||||
fill_in 'password', :with => 'abcdef'
|
fill_in 'password', :with => 'abcdef'
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_contain 'Invalid credentials'
|
assert_contain 'Invalid credentials'
|
||||||
ensure
|
|
||||||
I18n.reload!
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -77,15 +77,11 @@ class ConfirmationTest < ActionController::IntegrationTest
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'error message is configurable by resource name' do
|
test 'error message is configurable by resource name' do
|
||||||
begin
|
store_translations :en, :devise => {
|
||||||
I18n.backend.store_translations(:en, :devise => { :sessions =>
|
:sessions => { :admin => { :unconfirmed => "Not confirmed user" } }
|
||||||
{ :admin => { :unconfirmed => "Not confirmed user" } } })
|
} do
|
||||||
|
|
||||||
get new_admin_session_path(:unconfirmed => true)
|
get new_admin_session_path(:unconfirmed => true)
|
||||||
|
|
||||||
assert_contain 'Not confirmed user'
|
assert_contain 'Not confirmed user'
|
||||||
ensure
|
|
||||||
I18n.reload!
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue