Sha256: 02ab398254029c41b6b62551a3b65502737284910d97c15b0cd0cbfed42ee86b

Contents?: true

Size: 597 Bytes

Versions: 9

Compression:

Stored size: 597 Bytes

Contents

require 'rails_helper'

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

  it "renders a list of <%= ns_table_name %>" do
    render
<% for attribute in output_attributes -%>
    assert_select "tr>td", :text => <%= value_for(attribute) %>.to_s, :count => 2
<% end -%>
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

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