require 'rails_helper'

RSpec.describe "employees/new", type: :view do
  before(:each) do
    assign(:employee, Employee.new(
      :name => "MyString",
      :role => "MyString",
      :encrypted_access_code => "MyString"
    ))
  end

  it "renders new employee form" do
    render

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

      assert_select "input#employee_name[name=?]", "employee[name]"

      assert_select "input#employee_role[name=?]", "employee[role]"

      assert_select "input#employee_encrypted_access_code[name=?]", "employee[encrypted_access_code]"
    end
  end
end
