# Feature: Navigation links
#   As a visitor
#   I want to see navigation links
#   So I can find home, sign in, or sign up
feature 'Navigation links', :devise do
  # Scenario: View navigation links
  #   Given I am a visitor
  #   When I visit the home page
  #   Then I see "home," "sign in," and "sign up"
  scenario 'view navigation links' do
    visit root_path
    expect(page).to have_content 'Sign in'
    expect(page).to have_content 'Sign up'
  end

  # Scenario: Follow navigation links
  #   Given I am a visitor
  #   When I click a navigation link
  #   Then I see the proper web page
  scenario 'follow navigation links', js: :true do
    visit root_path
    @links = {
      'Play Now': '"/games/1"',
      'Browse Tables': 'tables_path',
      #'Tutorial': 'tutorial_path'
    }
    @links.each do |link|
      click_link link[0]
      #TODO: Remove race condition
      sleep 1
      expect(page.current_path).to eq(eval(link[1]))
      visit root_path
    end
  end

end
