fix question_answer for testing

This commit is contained in:
Kyle Drake 2014-10-27 17:17:12 -07:00
parent eec822f633
commit fdcaaf0177

9
app.rb
View file

@ -256,8 +256,13 @@ get '/?' do
end
def generate_question
question_first_number = rand 5
question_last_number = rand 5
if ENV['RACK_ENV'] == 'test'
question_first_number = 1
question_last_number = 1
else
question_first_number = rand 5
question_last_number = rand 5
end
session[:question_answer] = (question_first_number + question_last_number).to_s
[question_first_number, question_last_number]
end