require 'rails_helper'

RSpec.describe "employees/index", type: :view do
  before(:each) do
    assign(:employees, [
      Employee.create!(
        :name => "Name",
        :role => "Role",
        :encrypted_access_code => "Encrypted Access Code"
      ),
      Employee.create!(
        :name => "Name",
        :role => "Role",
        :encrypted_access_code => "Encrypted Access Code"
      )
    ])
  end

  it "renders a list of employees" do
    render
    assert_select "tr>td", :text => "Name".to_s, :count => 2
    assert_select "tr>td", :text => "Role".to_s, :count => 2
    assert_select "tr>td", :text => "Encrypted Access Code".to_s, :count => 2
  end
end
