Sha256: b70d316d1796786268c69bbac2ba1acb838cf8d7e404eb401e8ebd131c98671a

Contents?: true

Size: 672 Bytes

Versions: 5

Compression:

Stored size: 672 Bytes

Contents

require 'spec_helper'

<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
describe "<%= ns_table_name %>/new" do
  let(:<%= ns_file_name %>) { build :<%= ns_file_name %> }

  before do
    assign :<%= ns_file_name %>, <%= ns_file_name %>
  end

  it "renders new <%= ns_file_name %> form" do
    render

    assert_select "form[action=?][method=?]", <%= index_helper %>_path, "post" do
<% for attribute in output_attributes -%>
      assert_select "<%= attribute.input_type -%>#<%= ns_file_name %>_<%= attribute.name %>[name=?]", "<%= ns_file_name %>[<%= attribute.name %>]"
<% end -%>
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
stationed-0.4.0 lib/templates/rspec/scaffold/new_spec.rb
stationed-0.3.0 lib/templates/rspec/scaffold/new_spec.rb
stationed-0.2.0 lib/templates/rspec/scaffold/new_spec.rb
stationed-0.1.0 lib/templates/rspec/scaffold/new_spec.rb
stationed-0.0.1 lib/templates/rspec/scaffold/new_spec.rb