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

Rails 5.2 update fixture changes #477

Closed
sbeckeriv opened this issue Aug 17, 2020 · 0 comments
Closed

Rails 5.2 update fixture changes #477

sbeckeriv opened this issue Aug 17, 2020 · 0 comments

Comments

@sbeckeriv
Copy link

Dearest Maintainer,

I am upgrading a project from Rails 5.1 to 5.2. I am also currently using 5.1 version of the gem but i did not see how it would work in the 6 versions. In this Rails upgrade upgrade there is a change to how fixtures are treated. Assume we have an ActiveRecord model User who was many Bones for this issue. The change in Rails 5.2 [2] is that calling the users fixture without params now returns all fixtures. In my rspec api doc i have a helper called before all tests that defines all the params for the api i am calling.

parameter :name, "Name of the user", required: is_create
parameter :bones, "Array of names or ids of bones which this user is associated with.", scope: :user

I tracked the "issue" down to the SetParam build_param_hash.. The call will call the bones method that matches the fixture method name. in rails 5.1 bones returned [] and 5.2 it returns all the bones in the fixture data. In my test i am updating the name for example. The problem is that it says to update all the bones but also the bones are not the correct format. I want names or ids but I am getting the full hashed object.

I read the commits in this repro and issues and did not seem to find anything like this. I am currently duct taping the method if it matches a fixture name to return an array but this seems like something is being done incorrect.

Thank you for your time on this project and in reading my issue. Any advice is much appreciated.

Dictated but not read,
Becker

[2] rails/rails#28692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant