require 'rails_helper'

RSpec.describe "films/new", :type => :view do
  before(:each) do
    assign(:film, Film.new(
      :name => "MyString",
      :director => "MyString",
      :price => 1.5
    ))
  end

  it "renders new film form" do
    render

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

      assert_select "input#film_name[name=?]", "film[name]"

      assert_select "input#film_director[name=?]", "film[director]"

      assert_select "input#film_price[name=?]", "film[price]"
    end
  end
end
