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
Add Appraisal for Rails 6.1 #1418
Conversation
@vsppedro Yes, exactly. I think that would make the most sense. |
@vsppedro If it helps you to separate each case into its own PR that's fine with me! |
f0f1801
to
3eaa16c
Compare
I will try to describe why the tests are failing for future reference. Let's go with this first:
If you try to run the tests with Ruby 6.0 and 6.1 you will notice a diferent values for shoulda-matchers/lib/shoulda/matchers/active_model/validator.rb Lines 100 to 107 in 3da0956
For Rails 6.0 the value is: For Rails 6.1 the value is: In this new version each validation error is now being encapsulated as an ActiveModel::Error object. If you would like to know more about it take a look at this PR: Now I need to understand why the error message - 'Behavior has diverged'. - that was set up at the beginning of the test is not being used. |
Hi, @mcmire, I hope you're doing well. What do you think about removing this test:
And add an integration test to verify that validate_presence_of matcher is working with a customized message? |
Hi @vsppedro! I looked over the test file you linked to. It seems that the purpose of these tests is to make sure that the validation matchers can be used without specifying As for the test you highlighted, it's sort of a superfluous test in my opinion. It's also a bit weird. I don't really see how stubbing Rails provides confidence that our code is working correctly. So I would be fine with removing that completely, to be honest — I don't think you need to replicate it anywhere else. |
Oh thanks! Now I understand.
I was not seeing the value of this test, so I asked if I could remove it. Removing it would make my job of adding support for rails 6.1 much easier. Anyway, now I just need to correct two more tests. Thank you again. |
Another test fixed. Before:
Now is green. To fix this error was necessary to add the option :through before :source. This change makes sense to me, because, quoting the documentation: |
The unit tests are ok. The acceptance tests are not even starting, I'm not sure why. I will keep digging. |
I noticed that the tests were freezing on this line:
After some research, I found this link: I tried the solution, adding the command |
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 don't mind the addition of bundle install --binstubs
if it doesn't add much time to the test suite (it seems like that command should be pretty fast). This looks great!
TODO