require 'rails_helper'

RSpec.describe "settings/menu_categories/index", type: :view do
  before(:each) do
    assign(:settings_menu_categories, [
      Settings::MenuCategory.create!(
        :menu => nil,
        :name => "Name",
        :alt_name => "Alt Name",
        :order_by => 2,
        :menu_category => nil
      ),
      Settings::MenuCategory.create!(
        :menu => nil,
        :name => "Name",
        :alt_name => "Alt Name",
        :order_by => 2,
        :menu_category => nil
      )
    ])
  end

  it "renders a list of settings/menu_categories" do
    render
    assert_select "tr>td", :text => nil.to_s, :count => 2
    assert_select "tr>td", :text => "Name".to_s, :count => 2
    assert_select "tr>td", :text => "Alt Name".to_s, :count => 2
    assert_select "tr>td", :text => 2.to_s, :count => 2
    assert_select "tr>td", :text => nil.to_s, :count => 2
  end
end
