Hi,
I have the following example:
it ‘should have a form with an action attribute’ do
response.should have_tag( “form[action=?]”,
‘/users/1/machines/1/trouble_tickets’)
end
for a form like so:
<% form_for( :trouble_ticket,
:url => { :action => ‘create’,
:user_id => @machine.current_owner,
:machine_id => @machine } ) do |f| %>
…
Now this fails.
The way it will pass is to change the url parameters to explicitly
call
the id method on the
parameter values like so:
<% form_for( :trouble_ticket,
:url => { :action => ‘create’,
:user_id => @machine.current_owner.id,
:machine_id => @machine.id } ) do |f| %>
…
(nb. I am stubbing and mock these objects )
My thought is that rails does not require this since it helps by making
sure
the #id of each object is used in the action url.
Is this an error in rspec or just something (mildly inconsistent? )
which
I’ll have to do in this very limited context ?
Cheers!
sinclair