1
0
Fork 0
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:
Carlos Antonio da Silva 2009-11-22 22:46:57 -02:00
parent 40aaa98de9
commit fc89db636a
2 changed files with 6 additions and 13 deletions

View file

@ -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

View file

@ -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