Hi,<div><br class="webkit-block-placeholder"></div><div>I have the following example:</div><div><br class="webkit-block-placeholder"></div><div><div>&nbsp;&nbsp;it &#39;should have a form with an action attribute&#39; do&nbsp;</div><div>
&nbsp;&nbsp; &nbsp;response.should have_tag( &quot;form[action=?]&quot;, &#39;/users/1/machines/1/trouble_tickets&#39;)&nbsp;</div><div>&nbsp;&nbsp;end&nbsp;</div><br class="webkit-block-placeholder"></div><div>for a form like so:</div><div><br class="webkit-block-placeholder">
</div><div>&lt;% form_for( :trouble_ticket,&nbsp;</div><div>&nbsp;&nbsp; &nbsp;:url =&gt; { :action =&gt; &#39;create&#39;,&nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :user_id =&gt; @machine.current_owner,&nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :machine_id =&gt; @machine&nbsp;} ) do |f| %&gt;
</div><div>...</div><div><br class="webkit-block-placeholder"></div><div>Now this fails.</div><div><br class="webkit-block-placeholder"></div><div>The way it will pass is to change the url parameters to _explicitly_ call the id method on the&nbsp;
</div><div>parameter values like so:</div><div><br class="webkit-block-placeholder"></div><div><div>&lt;% form_for( :trouble_ticket,</div><div>&nbsp;&nbsp; &nbsp;:url =&gt; { :action =&gt; &#39;create&#39;,</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <b>:user_id =&gt; @
machine.current_owner.id,</b></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <b>:machine_id =&gt; @<a href="http://machine.id">machine.id</a></b> } ) do |f| %&gt;</div><div>...</div><div><br class="webkit-block-placeholder"></div><div>(nb. I am stubbing and mock these objects )
</div><div><br class="webkit-block-placeholder"></div><div>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.</div><div><br class="webkit-block-placeholder">
</div><div>Is this an error in rspec or just something (mildly inconsistent? ) which I&#39;ll have to do in this very limited context ?</div><div><br class="webkit-block-placeholder"></div><div>Cheers!</div><div>sinclair</div>
<div><br class="webkit-block-placeholder"></div></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div>