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

WIP: Add support for Rails 5 #960

Closed
wants to merge 6 commits into from
Closed

WIP: Add support for Rails 5 #960

wants to merge 6 commits into from

Conversation

mcmire
Copy link
Collaborator

@mcmire mcmire commented Sep 4, 2016

context 'an active_resource model' do
context 'with the validation context' do
it 'does not raise an exception' do
expect {

Choose a reason for hiding this comment

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

Avoid using {...} for multi-line blocks.

end

it 'accepts being mass-assignable for admin' do
expect(mass_assignable_as_admin).to allow_mass_assignment_of(:attr).as(:admin)

Choose a reason for hiding this comment

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

Line is too long. [88/80]

@stevebissett
Copy link

I came across this from:
http://stackoverflow.com/questions/39611716/how-do-i-test-associations-in-models-with-rspec-in-rails-5?noredirect=1#comment66531045_39611716

@mcmire - do you have any idea on when you might be done with this? Appreciate the work BTW.

@mcmire
Copy link
Collaborator Author

mcmire commented Sep 23, 2016

Hey @stevebissett,

Sorry for the wait on this. Unfortunately I don't really have a timeline for when this will be complete. I tend to work on it whenever I have time and I haven't had a whole lot of that lately.

@aried3r
Copy link

aried3r commented Mar 29, 2017

Hey @mcmire, I saw you sadly no longer have the time to maintain this project. I wanna start off by saying Thanks! for all your efforts so far! 👍

But wrt to this PR, would you be open to drop the conditionals for ActiveModel 3 and maybe some older Rails 4.x versions in favor of supporting Rails 5.0 and the upcoming 5.1 which will remove a lot of deprecated functions. It would require a new major release, but also means that there would be a working version of shoulda-matchers (3.x) for older Rails versions and a new, lighter version (because of dropping support) of it?

I even see unless active_model_3_2? || active_model_4_0? in this PR (although just moved).

@mcmire
Copy link
Collaborator Author

mcmire commented Mar 30, 2017

@aried3r Thanks for the support, it means a lot. :) Yeah, I am totally open to that. In fact for shoulda I have already removed support for Rails < 4.2: thoughtbot/shoulda@b9353e2, so I think we could definitely do the same thing here and release a new major version.

@em77
Copy link

em77 commented Jul 24, 2017

Hey @mcmire I just wanted to check in and see if there's any update on the timeline for this. I appreciate all the work you've put into this project and would like to see it continue to be compatible with Rails versions going into the future!

@guialbuk
Copy link
Collaborator

Hi, @em77 .
The Rails 5 support is in progress but it can be used in production (I'm using in two Rails 5.1 projects)
Point you Gemfile to rails-5 branch and you are good to go :)
https://github.com/thoughtbot/shoulda-matchers#getting-started

@em77
Copy link

em77 commented Jul 24, 2017

@guialbuk Hey thanks for the encouraging reply. So that branch is considered safe for rails 5.1? Is there any documentation of what methods or functionality are not working properly on rails 5.0 and 5.1?

@guialbuk
Copy link
Collaborator

@em77 It is safe to use on Rails 5.0 and 5.1 The list on the top of this PR (rails5 branch, not rails-5) is not up to date and many issues have been solved. Even Ruby 2.4 is supported in the rails-5branch.
The rails-5branch will soon be merged into master and become 4.0.beta1 version.

@mcmire
Copy link
Collaborator Author

mcmire commented Jul 24, 2017

@guialbuk I wonder if it would be helpful to keep this list up to date while the rails-5 branch is WIP (this way everyone knows, and it helps me triage things). I know you've merged the tables PR (#943) -- is there anything else that your branch has fixed, or is that it for now?

@mcmire
Copy link
Collaborator Author

mcmire commented Jul 24, 2017

(EDIT) Actually I think what I'll do is close this. @guialbuk is right -- if you'd like to know where things are at in terms of getting shoulda-matchers up to date with the latest Ruby and Rails changes, we've properly labeled open issues and PRs with Ruby 2.4 and Rails 5 tags, and it's easier to let GitHub keep that list automatically than aggregating one manually. Also, the rails-5 branch includes changes for both.

@mcmire mcmire closed this Jul 24, 2017
@mcmire mcmire deleted the rails5 branch September 9, 2017 02:33
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.

6 participants