-
Notifications
You must be signed in to change notification settings - Fork 357
Testing multiple versions of Rails #278
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
Conversation
|
Thanks for taking a first shot at this. I'll try to review later today. I would like to sort out the Travis issue, but unfortunately I'm not a project owner, just a contributor. That means I cannot see or edit the Travis config. @potenza @carloslopes Can you help us turn on Travis for PRs? |
This is an excellent start! I like the use of the appraisal gem, and it is hooked up nicely with Travis. Clearly we have some work to do in order to get tests passing on 4.1+. My concerns so far are:
|
We might be better of with a custom parser, which only checks a limited set of attributes. Because I already see issues with certain versions of Rails outputting different attributes and additional elements than others. |
Rather than risk reinventing the wheel, maybe we can continue using rails-dom-parser, but instead of BTW, thanks for taking the lead on this. If the scope of the work gets overwhelming and you want to split it up somehow, let me know and I'll do my best to help out. |
Also: I think Travis integration is working now. Next time you push commits to this PR the Travis build status should get hooked up. |
Cool, will see if I can squeeze in a update somewhere this week |
I added an `assert_equivalent_xml` ActionView::TestCase, and then I changed all the `assert_equal` to `assert_equivalent_xml`.
this to prevent differences in defaults between rails versions
as of rails 4.2 the utf8 hidden field is no longer wrapped in a div
for some reason EquivalentXml can't handle attributes with dashes, so a workaround is provided.
since rails 5 the type for a datetime field is `datetime-local` instead of `datetime`
@mattbrictson I finally got around fixing the tests (with the I can imagine that certain logic that is now part of |
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.
Excellent! This looks great. I had one comment about reorganizing require
statements. Otherwise, could you add a bit of documentation? Then I think this will be good to merge.
- Explain in the
README
how to run appraisals. - Mention in the
CHANGELOG
that the project is now tested against multiple versions of Rails (even though this is not a user-facing feature or bug fix, I think users will be excited to hear it).
Thanks!
test/bootstrap_radio_button_test.rb
Outdated
@@ -1,4 +1,6 @@ | |||
require 'test_helper' | |||
require 'nokogiri' | |||
require 'equivalent-xml' |
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.
I think these require
statements should move to test_helper.rb
?
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.
The only reason those require
statements are there is that's the file I arbitrarily chose to initially do the work. What I checked in yesterday I hadn't even reviewed myself. I didn't realize how quickly you were going to take the commit. :-) I agree the require
s should go in test_helper.rb
.
@lcreid I tried to invite you as a reviewer to this PR, but apparently GH only allows maintainers (?) to be reviewers. In any case, I would appreciate your 2¢ before merging this if you have time. Thanks! |
@mattbrictson it looks good to me. @koenpunt obviously knows this issue inside out, to be able to add the special cases so quickly. Let me know if I can help out in any other way. |
I've updated per the requested changes. We might consider enabling bundler cache to speed up the build on travis? |
@koenpunt Looks great. I don't think we need the bundler cache as part of this PR; we can always add it separately. Did you want a chance to squash some of the commits? I am fine either way. I'll merge as soon as I get a thumbs-up from you. |
No I'm good |
Merged! Thanks for the awesome PR ✨ |
This fixes #273