Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Use I18n for month select #40

wants to merge 3 commits into from

Conversation

acrogenesis
Copy link
Contributor

If your locale is not english it won't select months, this fixes it 馃憤

@calebhearth
Copy link
Owner

Lovely, thank you.

@calebhearth
Copy link
Owner

Can you add a spec for this method using a different locale?

@acrogenesis
Copy link
Contributor Author

Sure, give me a sec

@acrogenesis
Copy link
Contributor Author

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
Copy link
Owner

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great suggestion!

@acrogenesis
Copy link
Contributor Author

done 馃憤

@acrogenesis
Copy link
Contributor Author

bump

calebhearth added a commit that referenced this pull request Feb 6, 2015
* Add support for DateTime inputs. [#41](#41)
* Add installation instructions to README. [#39](#39)
* Use I18n for month select, allowing month names in locales other than
  English to be filled. [#40](#40)
@calebhearth
Copy link
Owner

Merged in e4eb895

calebhearth added a commit that referenced this pull request Feb 6, 2015
* Add support for DateTime inputs. [#41](#41)
* Add installation instructions to README. [#39](#39)
* Use I18n for month select, allowing month names in locales other than
  English to be filled. [#40](#40)
@acrogenesis acrogenesis closed this Feb 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants