Use to_param in scaffold spec templates #454

Merged
merged 2 commits into from Dec 4, 2011

2 participants

@attilagyorffy

Action Pack uses to_param for constructing an URL to objects. The default implementation returns this record’s id as a String. This way even if to_param is overridden in an ActiveRecord object, the controller spec templates are still going to be valid and will still work.

I understand that even though when using a scaffold, to_param will equal to .id, I still think that RSpec-Rails should be following the Rails conventions and use to_param instead.

attilagyorffy added some commits Oct 20, 2011
@attilagyorffy attilagyorffy Fix typo in the upgrade instructions. 4a0a855
@attilagyorffy attilagyorffy Use .to_param instead of .id in controller spec templates.
Action Pack uses to_param for constructing an URL to objects. The default implementation returns this record’s id as a String. This way even if to_param is overridden in an ActiveRecord object, the controller spec templates are going to still work.
412b38a
@dchelimsky dchelimsky merged commit d05c3ef into rspec:master Dec 4, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment