38 lines
1018 B
Ruby
38 lines
1018 B
Ruby
# 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': '"/tables/1"',
|
|
'Browse Tables': 'tables_path',
|
|
#'Tutorial': 'tutorial_path'
|
|
}
|
|
@links.each do |link|
|
|
click_link link[0]
|
|
#TODO: Remove race condition
|
|
sleep 4
|
|
page.save_screenshot
|
|
expect(page.current_path).to eq(eval(link[1]))
|
|
visit root_path
|
|
end
|
|
end
|
|
|
|
end
|