Sha256: b85ae090e46bd4e3f6471814dde86710e06aea6c1bde81f2ba54bb36ce251672

Contents?: true

Size: 837 Bytes

Versions: 1

Compression:

Stored size: 837 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_bot_let_definitions %>
  <%= model.factory_bot_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

1 entries across 1 versions & 1 rubygems

Version Path
model_base_generators-0.4.0 lib/templates/rspec/scaffold/new_spec.rb