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 #913 for Serialize Matcher error undefined method `cast_type' in Rails 5 #965

Closed
wants to merge 1 commit into from

Conversation

bsodmike
Copy link
Contributor

@bsodmike bsodmike commented Oct 18, 2016

This patch is based on the discussed held in issue #913, and a solution
that I've proposed and others have confirmed as good to go 👏.

Oh, it also fixes spec breakage (for the existing spec).

Ref: #913 (comment)

…_type' in Rails 5

This patch is based on the discussed held in issue thoughtbot#913, and a solution
that I've proposed and others have confirmed as good to go 👏.

Ref: thoughtbot#913 (comment)
@mcmire
Copy link
Collaborator

mcmire commented Oct 18, 2016

Thank you @bsodmike. I'm still here... I just haven't had a whole lot of time lately. But I will get to this.

@bsodmike
Copy link
Contributor Author

@mcmire thanks - there seems to be an issue with CI. ta.

@aried3r
Copy link

aried3r commented Oct 19, 2016

I think it's because this PR does not differ between Rails 5 and 4 like the proposed patch in your comment. What do you think?

@bsodmike
Copy link
Contributor Author

Also it doesn't seem like CI got very far?

Your bundle is complete!
It was installed into ./vendor/bundle
6.23s$ bundle exec rake
rake spec:unit --trace
** Invoke spec:unit (first_time)
** Execute spec:unit
Non shoulda-matchers warnings were raised during the test run. These have been written to /home/travis/build/thoughtbot/shoulda-matchers/tmp/irrelevant_warnings.txt.
All warnings were written to /home/travis/build/thoughtbot/shoulda-matchers/tmp/all_warnings.txt.
rake aborted!
Command failed with status (1): [rake spec:unit --trace...]
/home/travis/build/thoughtbot/shoulda-matchers/Rakefile:25:in `block in <top (required)>'
Tasks: TOP => default
(See full trace by running task with --trace)

This spec was broken locally if I set the version of Rails to 5.0.

@mcmire
Copy link
Collaborator

mcmire commented Oct 19, 2016

Usually when rake quits early like that and doesn't show any output it means that some file failed to load. Locally if you run, for instance, bundle exec appraisal 5.0 rake, then you may be able to see what's going on.

@DexterTheDragon
Copy link

I ran the tests for this PR locally and this is the error it's failing on

undefined method `active_model_lte_4?' for #<Class:0x00557be9b418f0> (NoMethodError)
Did you mean?  active_model_4_0?
               active_model_3_2?
               active_model_3_1?
        from shoulda-matchers/spec/unit/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb:4:in `block in <top (required)>'

This commit on the rails5 branch adds a call to the active_model_lte_4? method but it's not defined anywhere. 6c2fb57#diff-b8e72e4bed24a5c78f9bcc34440ba96bR4

If you look at the tests results for the rails5 branch in PR #960 it is failing the same way. The test failures would need to be resolved on the rails5 branch and then this fix rebased on to it.

Hopefully this help in moving along the Rails 5 support.

@mcmire
Copy link
Collaborator

mcmire commented Jul 25, 2017

Hey @bsodmike -- thanks so much for your PR, I apologize for the long delay in getting this in. We're still working on upgrading shoulda-matchers for Rails 5 but I've added this PR to the rails-5 branch here: 28a43a3. So I'm closing this so it doesn't clutter up the issues list. Thanks! 🎉

@mcmire mcmire closed this Jul 25, 2017
@mcmire mcmire added this to the v4.0 milestone Sep 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants