require 'rails_helper'

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

  it "renders the edit employee form" do
    render

    assert_select "form[action=?][method=?]", employee_path(@employee), "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
