Add more tests for Bots
This commit is contained in:
parent
86085206e4
commit
54b2e4bec6
@ -3,17 +3,31 @@
|
|||||||
# I want to add a bot to a table
|
# I want to add a bot to a table
|
||||||
# So I can play against the computer
|
# So I can play against the computer
|
||||||
feature 'Add bot', type: :feature do
|
feature 'Add bot', type: :feature do
|
||||||
|
before(:each) do
|
||||||
|
@table = FactoryGirl.create :table
|
||||||
|
visit table_path @table
|
||||||
|
end
|
||||||
# Scenario: User can add a bot if there is room at the table
|
# Scenario: User can add a bot if there is room at the table
|
||||||
# Given I can edit the table
|
# Given I can edit the table
|
||||||
# When I see the table with an empty seat
|
# When I see the table with an empty seat
|
||||||
# Then I see a button to add a bot
|
# Then I see a button to add a bot
|
||||||
scenario 'visitor can add a bot if the seat is empty' do
|
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
|
@button = page.find_button('+ Bot', match: :first).click
|
||||||
expect(page).to have_content "BotPlayer"
|
expect(page).to have_content "BotPlayer"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario 'visitor can not add a bot if the seat is occupied by bot' do
|
||||||
|
@button = page.find_button('+ Bot', match: :first).click
|
||||||
|
@button = page.find_button('+ Bot', match: :first).click
|
||||||
|
expect(page).to have_content "Failed to add Bot"
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'visitor can not add a bot if the seat is occupied by visitor' do
|
||||||
|
@button = page.find_button('Sit', match: :first).click
|
||||||
|
@button = page.find_button('+ Bot', match: :first).click
|
||||||
|
expect(page).to have_content "Failed to add Bot"
|
||||||
|
end
|
||||||
|
|
||||||
scenario 'user can add a bot if the table is not full' do
|
scenario 'user can add a bot if the table is not full' do
|
||||||
skip "To be implemented"
|
skip "To be implemented"
|
||||||
#signin('test@example.com', 'please123')
|
#signin('test@example.com', 'please123')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user