[LRUG] Cucumber and mass assignment whitelisting
James McCarthy
james2mccarthy at gmail.com
Tue Feb 16 09:31:29 PST 2010
Jay,
Machinist doesn't use mass assignment it loops over the attributes and
assigns them individually (incidentally it does it assigns the
attributes of the named blueprints before it assigns the base
blueprint).
J.
On Tue, Feb 16, 2010 at 8:48 AM, Jay Caines-Gooby <jay at gooby.org> wrote:
> Hiya,
>
> I'm a long time lurker. I'm doing The Right ThingTM with a new project
> and it's Cucumber, Machinist, Haml and Sass all the way. Loving Sass
> mixins!
>
> My question:
>
> If I'm white-listing my model attributes from mass-assignment with an
> initializer in security.rb:
>
> ActiveRecord::Base.send(:attr_accessible, nil)
>
> my tests fail horribly, because cucumber, machinist et al are using
> mass assignment to create the test objects.
>
> Is there a way to make the two play nicely together?
>
>
> --
> Jay Caines-Gooby
> http://jay.gooby.org
> jay at gooby.org
> +44 (0)7956 182625
> twitter, skype & aim: jaygooby
> gtalk: jaygooby at gmail.com
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
--
James
More information about the Chat
mailing list