Sha256: c547e83779d0c5bca877b53a29fc72f1db71b19e12d6cafbf9310ccb1513730a

Contents?: true

Size: 925 Bytes

Versions: 2

Compression:

Stored size: 925 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper')

<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
describe "/<%= plural_name %>/show.html" do
  before do
    assigns[:<%= file_name %>] = @<%= file_name %> = stub_model(<%= class_name %><%= output_attributes.empty? ? ')' : ',' %>
<% output_attributes.each_with_index do |attribute, attribute_index| -%>
      :<%= attribute.name %> => <%= attribute.default.inspect %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
<% end -%>
<% if !output_attributes.empty? -%>
    )
<% end -%>
  end

  it "should render attributes in <p>" do
    render "<%= plural_name %>/show.html"
<% for attribute in output_attributes -%>
    response.should have_text(/<%= Regexp.escape(attribute.default.inspect).gsub(/^"|"$/, '')%>/)
<% end -%>
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
hashrocket-hashrocket-terraformation-0.0.0 rails_generators/terrascaffold/templates/view_show.html_spec.rb.erb
hashrocket-terraformation-0.0.0 rails_generators/terrascaffold/templates/view_show.html_spec.rb.erb