Sha256: cd183074ab97ba15f031e1c47516a904167d3a153681ad531efffd6e9e0fea68

Contents?: true

Size: 760 Bytes

Versions: 1

Compression:

Stored size: 760 Bytes

Contents

require 'spec_helper'

<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
describe "<%= ns_table_name %>/edit.html.<%= options[:template_engine] %>" do
  before(:each) do
    @<%= ns_file_name %> = assign(:<%= ns_file_name %>, Factory(:<%= ns_file_name %>) )
  end

  it "renders the edit <%= ns_file_name %> form" do
    render

    rendered.should have_selector("form", :action => <%= index_helper %>_path(@<%= ns_file_name %>), :method => "post") do |form|
    <% for attribute in output_attributes -%>
  form.should have_selector("<%= attribute.input_type -%>#<%= ns_file_name %>_<%= attribute.name %>", :name => "<%= ns_file_name %>[<%= attribute.name %>]")
    <% end -%>
end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
leonardo-1.5.0 lib/generators/leolay/templates/lib/templates/rspec/scaffold/edit_spec.rb