Chris Mear wrote in post #996461:
> On 3 May 2011, at 15:05, Matt S. wrote:
>
@asset.build_owner
>> Here is the rendered content:
>>>
>> a lot about other things!
>>
>> If you want to see everything you can do a 'git clone
>> git://github.com/matthewcalebsmith/asset_owner.git' to get the
On 3 May 2011, at 15:05, Matt S. wrote:
> Chris Mear wrote in post #996234:
>> On 2 May 2011 00:58, Matt S. wrote:
>>> accepts_nested_attributes_for.)
>>> before(:each) do
>>> end
>>> <%= f.fields_for :owner do |owner_fields| %>
>>>
>>> class AssetController < ApplicationController
>>> def new
>
Chris Mear wrote in post #996234:
> On 2 May 2011 00:58, Matt S. wrote:
>> accepts_nested_attributes_for.)
>> before(:each) do
>> end
>> <%= f.fields_for :owner do |owner_fields| %>
>>
>> class AssetController < ApplicationController
>> def new
>> @asset = Asset.new
>> @asset.build_owner
>> end
On 2 May 2011 00:58, Matt S. wrote:
> 1) Is there a way to make this trivial example spec to pass? (If so,
> how?)
>
> 2) Advice: I would like to write more view specs, especially on views
> for models with more complex relationships. Is it worth it?
>
> (The reason I ask this somewhat rhetorical
1) Is there a way to make this trivial example spec to pass? (If so,
how?)
2) Advice: I would like to write more view specs, especially on views
for models with more complex relationships. Is it worth it?
(The reason I ask this somewhat rhetorical question is because I cannot
find any examples of
Matt S. wrote in post #991032:
>> In similar view specs, I've stubbed #owner_attributes= on the 'assets'
>> mock. I think Rails' nested form/assignment implementation does a
>> check on the existence of this method to make sure that the Asset
>> model does indeed accept nested assignment for that a
Chris Mear wrote in post #990804:
> On 4 April 2011 02:00, Matt S. wrote:
>> let(:owner) { mock_model("Owner").as_new_record.as_null_object }
>> assert_select "input#asset_name", :name => "asset[name]" # passes
>> <%= f.label :name %>
>>
>> <%= f.submit %>
>>
>> <% end %>
>
> In similar view
On 4 April 2011 02:00, Matt S. wrote:
> For some reason I can't figure out how to make the fields_for tags
> render in the trivial example below; however, it works in the browser.
> What does #build_association do that my stubbed method does not
> replicate? (Or is that even the issue?)
>
> I appr
For some reason I can't figure out how to make the fields_for tags
render in the trivial example below; however, it works in the browser.
What does #build_association do that my stubbed method does not
replicate? (Or is that even the issue?)
I appreciate the insight. Thanks! Matt Smith
#spec/view