-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support dynamic external_tool_url. Fixes #21 #22
base: master
Are you sure you want to change the base?
Conversation
setup do | ||
Capybara.current_driver = Capybara.javascript_driver # :selenium by default | ||
|
||
# monkey patch external_tool_url |
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.
hmm. I would think there must be a better way. It should be possible to pass in the lambda as a config option just like you do in a regular app.
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.
Well I tried but after Rails initializes the middleware it freezes the array. I tried deleting or swapping the current instance of I18nViz middleware with another one, which has the lambda configured but without luck. Maybe it is due to Rails specifics, I don't know, but this is the only way I managed to get this test working.
7c24fe0
to
5aa811f
Compare
I've updated the test to take into account the currently selected locale. You can either use parameters from the environment or I18n.locale (.default_locale). I've also added a sample translation file for Bulgarian, for completeness. |
@jhilden ping. Please see my previous comment about the monkey patch in the test. If we had rspec (and rspec-mocks) I could make this code look a bit cleaner by doing something like
which essentially does the same as the monkey-patch behind the scenes. What do you think, which one would you prefer ? |
@atodorov I'm sorry that I didn't have time to take another bigger look at your code, it's certainly on my list. concerning Rspec: I'm definitely not against switching to Rspec at all, I also prefer it nowadays, but I currently just don't have the time to do it. |
5aa811f
to
42a0c7f
Compare
@jhilden ping. any update here, it's been a while. Are you still against the monkey-patch piece of code within the tests ? |
thanks for pinging me again @atodorov I totally forgot takeing another look at this. I'm not strictly against the monkey patch within the tests, IF there is no easy other solution. So that would not be a blocker for me to merge the PR. However, the tests seem to be failing now with:
I think this should be worked on. |
42a0c7f
to
41e5891
Compare
@jhilden the error looks like Travis wasn't able to install all the required gems although the log appears to show everything as installed before we run the tests. I'm pretty sure it is not related to the current changes but I can't help further ATM. |
f348d15
to
8dc03ca
Compare
@jhilden I've spent more time on this today. The selenium problem (cherry-picked here) and the HTML nested tags are fixed in #25 (I hope). Now about the failures we're observing here:
The assertion which fails is looking for the tooltip links when i18n_viz is enabled so I fixed it with
|
@jhilden please review.