thirteen-tien-len_classic/spec/features/bots/add_bot_players_spec.rb

29 lines
883 B
Ruby

# Feature: Add bot to table
# As a user
# I want to add a bot to a table
# So I can play against the computer
feature 'Add bot', type: :feature do
# Scenario: User can add a bot if there is room at the table
# Given I can edit the table
# When I see the table with an empty seat
# Then I see a button to add a bot
scenario 'visitor can add a bot if the seat is empty' do
@table = FactoryGirl.create :table
visit table_path @table
@button = page.find_button('+ Bot', match: :first).click
expect(page).to have_content "BotPlayer"
end
scenario 'user can add a bot if the table is not full' do
skip "To be implemented"
#signin('test@example.com', 'please123')
#create table
#visit table_path @table
#join table
#expect(page).to have_button('Add bot')
#click_button 'Add bot'
#expect table players +=1
end
end