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
|
||||
|
||||
test 'error message is configurable by resource name' do
|
||||
begin
|
||||
I18n.backend.store_translations(:en, :devise => { :sessions =>
|
||||
{ :admin => { :invalid => "Invalid credentials" } } })
|
||||
|
||||
store_translations :en, :devise => {
|
||||
:sessions => { :admin => { :invalid => "Invalid credentials" } }
|
||||
} do
|
||||
sign_in_as_admin do
|
||||
fill_in 'password', :with => 'abcdef'
|
||||
end
|
||||
|
||||
assert_contain 'Invalid credentials'
|
||||
ensure
|
||||
I18n.reload!
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -77,15 +77,11 @@ class ConfirmationTest < ActionController::IntegrationTest
|
|||
end
|
||||
|
||||
test 'error message is configurable by resource name' do
|
||||
begin
|
||||
I18n.backend.store_translations(:en, :devise => { :sessions =>
|
||||
{ :admin => { :unconfirmed => "Not confirmed user" } } })
|
||||
|
||||
store_translations :en, :devise => {
|
||||
:sessions => { :admin => { :unconfirmed => "Not confirmed user" } }
|
||||
} do
|
||||
get new_admin_session_path(:unconfirmed => true)
|
||||
|
||||
assert_contain 'Not confirmed user'
|
||||
ensure
|
||||
I18n.reload!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue