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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix internationalization errors on tests #8

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

nikosmichas
Copy link

The following tests are failing currently

  test_should_fail_if_event_has_no_transition                     FAIL (0.02s)
        --- expected
        +++ actual
        @@ -1 +1 @@
        -["State event cannot transition when idling"]
        +["State event translation missing: en.mongoid.errors.models.mongoid_test/foo.attributes.state_event.invalid_event"]
        /home/app/test/machine_with_event_attributes_on_validation_test.rb:25:in `test_should_fail_if_event_has_no_transition'

  test_should_use_defaults                                        FAIL (0.03s)
        --- expected
        +++ actual
        @@ -1 +1 @@
        -["State cannot transition via \"ignite\""]
        +["State cannot ignite"]
        /home/app/test/machine_with_internationalization_test.rb:24:in `test_should_use_defaults'

  test_should_only_add_locale_once_in_load_path                   FAIL (0.01s)
        Expected: 1
          Actual: 0
        /home/app/test/machine_with_internationalization_test.rb:150:in `test_should_only_add_locale_once_in_load_path'

  test_should_invalidate_using_errors                             FAIL (0.02s)
        --- expected
        +++ actual
        @@ -1 +1 @@
        -["State cannot transition via \"park\""]
        +["State translation missing: en.mongoid.errors.models.mongoid_test/foo.attributes.state.invalid_transition"]
        /home/app/test/machine_with_validations_test.rb:17:in `test_should_invalidate_using_errors'

All those are translations related.
Adding the StateMachines::Integrations::Mongoid.locale_path to I18n.load_path allows the tests to run without failure.

The translations cannot be loaded if the path is not there leading to 4 failing tests
@seuros
Copy link
Member

seuros commented Jul 1, 2020

Can you add all the other gemfile ?

@nikosmichas
Copy link
Author

Can you add all the other gemfile ?

Sure, added for 5.0, 5.2 and 6.0. Is edge also needed like here ?

@seuros
Copy link
Member

seuros commented Jul 1, 2020

Yes 5.1.
Thanks

@seuros
Copy link
Member

seuros commented Jul 1, 2020

You should drop old version of ruby to pass the whole matrix.

You can drop tests in any unsupported versions of rails too.

@nikosmichas nikosmichas force-pushed the fix_internationalization_errors_on_tests branch from 61476e8 to 58e7f8b Compare July 2, 2020 06:44
@nikosmichas nikosmichas force-pushed the fix_internationalization_errors_on_tests branch from 58e7f8b to 097f885 Compare July 2, 2020 06:51
@nikosmichas
Copy link
Author

@nikosmichas
Copy link
Author

Hello @seuros
Do you need anything else for this PR ?

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.

2 participants