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

Rake spec failures on Rails 3.2.3 #302

Closed
kbighorse opened this issue Apr 14, 2012 · 4 comments
Closed

Rake spec failures on Rails 3.2.3 #302

kbighorse opened this issue Apr 14, 2012 · 4 comments

Comments

@kbighorse
Copy link

Followed install instructions, ran rake testbed and failed to run 'bundle exec rake spec' and got this fail:

https://gist.github.com/2388779

Trying to support Formtastic 2.x, but can't even run the current codebase tests yet. Will start with this, but if anyone knows the problem offhand, would be greatly appreciated.

Kimball

@yoon
Copy link
Member

yoon commented Apr 16, 2012

Looks like the issue is "Can't mass-assign protected attributes" on all of the various model attributes. Are you using attr_protected or attr_accessible anywhere? What version of Rails are you using?

@rsutphin
Copy link
Contributor

I can reproduce the failures with Rails 3.2.3. They do not happen with Rails 3.2.2, 3.1.4, or 3.0.12, though the deprecation warnings are present on 3.2.2 also.

@kbighorse, if you'd like to keep working on your formtastic patch while we look into this issue, you can have your surveyor dev environment work with Rails 3.1 instead of 3.2:

$ export RAILS_VERSION=3.1
$ bundle update && rake testbed
$ bundle exec rake spec

Thanks for your interest.

@rsutphin
Copy link
Contributor

The cause:

This release changes the default value of config.active_record.whitelist_attributes to true.
This change only affects newly generated applications so it should not cause any backwards
compatibility issues for users who are upgrading but it may affect some tutorials and
introductory material.

rake testbed creates a new application, so config.active_record.whitelist_attributes will be true. Since this will be the policy in Rails going forward, we should probably add attr_accessible for the attributes that the surveyor controller expects to be able to set.

@kbighorse
Copy link
Author

I'm out of the country til the 25th, I'll revisit then. I am using Rails 3.1.4, though, so that'll be the first thing I investigate.

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

3 participants