mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
fix question_answer for testing
This commit is contained in:
parent
eec822f633
commit
fdcaaf0177
1 changed files with 7 additions and 2 deletions
9
app.rb
9
app.rb
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue