Browse files

don't generate :new_record? => false

  • Loading branch information...
1 parent 012fd22 commit d38e51f24c3c647033f8dc521f418568eec81ccf @dchelimsky dchelimsky committed Nov 22, 2010
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/generators/rspec/scaffold/templates/edit_spec.rb
View
5 lib/generators/rspec/scaffold/templates/edit_spec.rb
@@ -3,12 +3,11 @@
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
describe "<%= table_name %>/edit.html.<%= options[:template_engine] %>" do
before(:each) do
- @<%= file_name %> = assign(:<%= file_name %>, stub_model(<%= class_name %>,
- :new_record? => false<%= output_attributes.empty? ? '' : ',' %>
+ @<%= file_name %> = assign(:<%= file_name %>, stub_model(<%= class_name %><%= output_attributes.empty? ? '))' : ',' %>
<% output_attributes.each_with_index do |attribute, attribute_index| -%>
:<%= attribute.name %> => <%= attribute.default.inspect %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
<% end -%>
- ))
+<%= output_attributes.empty? ? "" : " ))\n" -%>
end
it "renders the edit <%= file_name %> form" do

0 comments on commit d38e51f

Please sign in to comment.