Sha256: b9f19b7c8059767d02210ad24a6b13f9e19047a4633425ea4f19225ca8d8efa7

Contents?: true

Size: 839 Bytes

Versions: 6

Compression:

Stored size: 839 Bytes

Contents

<%- unless ModelBase.config.frozen_string_literal.nil? -%>
# frozen_string_literal: <%= ModelBase.config.frozen_string_literal.inspect %>
<%- end -%>
require 'rails_helper'

<% output_attributes = model.columns.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
RSpec.describe '<%= ns_table_name %>/new', <%= type_metatag(:view) %> do
  <%= model.factory_girl_let_definitions %>
  <%= model.factory_girl_let_definition(action: :build) %>
  before(:each) do
    assign(:<%= model.full_resource_name %>, <%= model.full_resource_name %>)
  end

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

    assert_select 'form[action=?][method=?]', <%= index_helper %>_path, 'post' do
<% model.columns_for(:form).each do |attribute| -%>
      <%= attribute.assert_select_exp %>
<% end -%>
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
model_base_generators-0.3.9 lib/templates/rspec/scaffold/new_spec.rb
model_base_generators-0.3.8 lib/templates/rspec/scaffold/new_spec.rb
model_base_generators-0.3.7 lib/templates/rspec/scaffold/new_spec.rb
model_base_generators-0.3.6 lib/templates/rspec/scaffold/new_spec.rb
model_base_generators-0.3.5 lib/templates/rspec/scaffold/new_spec.rb
model_base_generators-0.3.4 lib/templates/rspec/scaffold/new_spec.rb