Commit fde2d38a authored by Joe Libipl's avatar Joe Libipl
Browse files

Added good and bad ending tests

parent d3549419
Pipeline #10826382 passed with stage
in 1 minute and 1 second
......@@ -205,4 +205,32 @@ describe SMSBeholder do
end
end
it 'can be played to a good ending' do
get '/', From: @dude
Timeout::timeout(10) do
until last_response.body.include?('Royalty does not concern itself with common dances.') ||
last_response.body.include?('True power is slow dancing with someone who could beat you senseless.') ||
last_response.body.include?('Thirst for knowledge. Hunger for power. No feast is fine enough.') do
@dude += '0' if last_response.body.include?('And you won\'t be alone...')
get '/', From: @dude, Body: ['1','2','3'].sample
puts last_response.body
end
end
end
it 'can be played to a bad ending' do
get '/', From: @dude
Timeout::timeout(10) do
until last_response.body.include?('And you won\'t be alone...') do
if last_response.body.include?('Royalty does not concern itself with common dances.') ||
last_response.body.include?('True power is slow dancing with someone who could beat you senseless.') ||
last_response.body.include?('Thirst for knowledge. Hunger for power. No feast is fine enough.')
@dude += '0'
end
get '/', From: @dude, Body: ['1','2','3'].sample
puts last_response.body
end
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment