Sha256: 12565927cd504e365b2078872ff41c4466c792ee08f6a463fcaffb7207b253ad
Contents?: true
Size: 1.03 KB
Versions: 4
Compression:
Stored size: 1.03 KB
Contents
require 'rails_helper' <% output_attributes = model.columns.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%> RSpec.describe "<%= ns_table_name %>/index", <%= type_metatag(:view) %> do <%= model.factory_girl_let_definitions %> before(:each) do assign(:<%= table_name %>, [ <% [1,2].each_with_index do |id, model_index| -%> <%- if tc = model.title_column -%> <%= model.factory_girl_create(tc.name.to_sym => tc.sample_value(model_index + 1)) %>, <%- else -%> <%= model.factory_girl_create %>, <%- end -%> <% end -%> ]) end it "renders a list of <%= ns_table_name %>" do render <% model.columns_for(:spec_index).each do |attribute| -%> <%- if attribute.single_sample_only? -%> assert_select "tr>td", :text => <%= attribute.sample_string_exp %>, :count => 2 <%- else -%> assert_select "tr>td", :text => <%= attribute.sample_string_exp(1) %>, :count => 1 assert_select "tr>td", :text => <%= attribute.sample_string_exp(2) %>, :count => 1 <%- end -%> <% end -%> end end
Version data entries
4 entries across 4 versions & 1 rubygems