-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use I18n for month select #40
Conversation
Lovely, thank you. |
Can you add a spec for this method using a different locale? |
Sure, give me a sec |
ready 馃憤 |
expect(page.find('#user_date_of_birth_1i').value).to eq('1980') | ||
expect(page.find('#user_date_of_birth_2i').value).to eq('1') | ||
expect(page.find('#user_date_of_birth_3i').value).to eq('2') | ||
I18n.locale = :en |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since expect
will raise an error (in a failure case) and the RSpec runner will catch it, we need to ensure this global state is reset. My suggestion:
it '...' do
begin
I18n.locale = :es
# the rest of the spec
ensure
I18n.locale = :en
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great suggestion!
done 馃憤 |
bump |
Merged in e4eb895 |
If your locale is not english it won't select months, this fixes it 馃憤