public
Rubygem
Fork of thoughtbot/shoulda
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/technicalpickles/shoulda.git
using to_param instead of id in make_parent_params (Bryan Liles - 
lighthouse #23)

git-svn-id: https://svn.thoughtbot.com/plugins/shoulda/trunk@382 
7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
tsaleh (author)
Mon Mar 10 07:38:09 -0700 2008
commit  2d92da234fcc78797b6ca7642ae14466305e7f8a
tree    4733b62ef2094d882ff0e05d6a455b81465e288c
parent  b21218df9973d42a3f3e277e2156158b5f694288
...
145
146
147
148
 
149
150
151
...
455
456
457
458
 
459
460
461
...
145
146
147
 
148
149
150
151
...
455
456
457
 
458
459
460
461
0
@@ -145,7 +145,7 @@ module ThoughtBot # :nodoc:
0
           attr_accessor :identifier
0
           
0
           # Name of the ActiveRecord class this resource is responsible for. Automatically determined from
0
- # test class if not explicitly set. UserTest => :user
0
+ # test class if not explicitly set. UserTest => "User"
0
           attr_accessor :klass
0
 
0
           # Name of the instantiated ActiveRecord object that should be used by some of the tests.
0
@@ -455,7 +455,7 @@ module ThoughtBot # :nodoc:
0
           parent_name = parent_names.shift
0
           parent = record ? record.send(parent_name) : parent_name.to_s.classify.constantize.find(:first)
0
 
0
- { :"#{parent_name}_id" => parent.id }.merge(make_parent_params(resource, parent, parent_names))
0
+ { :"#{parent_name}_id" => parent.to_param }.merge(make_parent_params(resource, parent, parent_names))
0
         end
0
 
0
       end

Comments

    No one has commented yet.