Sha256: fe0a790998ba50547972969e628aad7e7a1a6f262f13f033db7ac2854aba7409

Contents?: true

Size: 804 Bytes

Versions: 12

Compression:

Stored size: 804 Bytes

Contents

require 'rails_helper'

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

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

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

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
model_base_generators-0.1.1 lib/templates/rspec/scaffold/edit_spec.rb
model_base_generators-0.1.0 lib/templates/rspec/scaffold/edit_spec.rb
silmarails-0.3.4 lib/generators/silmarails/install/files/templates/rspec/scaffold/edit_spec.rb
silmarails-0.3.2 lib/generators/silmarails/install/files/templates/rspec/scaffold/edit_spec.rb
silmarails-0.3.1 lib/generators/silmarails/install/files/templates/rspec/scaffold/edit_spec.rb
silmarails-0.3.0 lib/generators/silmarails/install/files/templates/rspec/scaffold/edit_spec.rb
silmarails-0.2.2 lib/generators/silmarails/install/files/templates/rspec/scaffold/edit_spec.rb
silmarails-0.2.1 lib/generators/silmarails/install/files/templates/rspec/scaffold/edit_spec.rb
silmarails-0.2.0 lib/generators/silmarails/install/files/templates/rspec/scaffold/edit_spec.rb
silmarails-0.1.1 lib/generators/silmarails/install/files/templates/rspec/scaffold/edit_spec.rb
genesis_rails-0.1.1 lib/generators/genesis_rails/install/files/templates/rspec/scaffold/edit_spec.rb
genesis_rails-0.1.0 lib/generators/genesis_rails/install/files/templates/rspec/scaffold/edit_spec.rb