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

[Backport] Refactor translatable specs #2903

Merged
merged 4 commits into from
Sep 17, 2018

Conversation

javierm
Copy link
Member

@javierm javierm commented Sep 17, 2018

References

Objectives

Refactor translatable specs into shared examples so we don't have to add 150 lines of (similar) code every time we make a new translatable model (currently we're in the process of adding 6 more translatable models).

Notes

By doing so and including it in ActionDispatch::Routing::UrlFor, we make
it available in controllers, helpers and specs, and so we can remove the
duplication we had there with methods dealing with the same problem.

Even if monkey-patching is ugly, using a different module and executing
ActionDispatch::Routing::UrlFor.send(:include, MyModule) wouldn't make
the method available in the controller.
Using `have_content` detected textareas, but not text input contents.

All credit to Marko (mlovic) for finding the issue and suggesting the
implemented solution.
Copy link
Member

@voodoorai2000 voodoorai2000 left a comment

Choose a reason for hiding this comment

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

Fantastic! 👌

@voodoorai2000 voodoorai2000 merged commit 71a537b into master Sep 17, 2018
@voodoorai2000 voodoorai2000 deleted the backport-refactor-translatable-specs branch September 17, 2018 21:05
@mlovic mlovic mentioned this pull request Sep 20, 2018
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