require 'rails_helper'

RSpec.describe "products/new", :type => :view do
  before(:each) do
    assign(:product, Product.new(
      :model_number => "MyString",
      :name => "MyText"
    ))
  end

  it "renders new product form" do
    render

    assert_select "form[action=?][method=?]", products_path, "post" do

      assert_select "input#product_model_number[name=?]", "product[model_number]"

      assert_select "textarea#product_name[name=?]", "product[name]"
    end
  end
end
