Commit 15de5fae authored by Joe Libipl's avatar Joe Libipl
Browse files

Constants in conditionalSelection

parent a2034cd2
Pipeline #10388303 passed with stage
in 1 minute and 8 seconds
......@@ -42,6 +42,11 @@ class SMSBeholder < Sinatra::Base
response += "\n#{index + 1}) #{selection}"
end
end
if @states[state] && @states[state].key?('conditionalSelection')
@states[state]['conditionalSelection']['constants'].keys.each_with_index do |selection, index|
response += "\n#{index + 1}) #{selection}"
end
end
response
end
end
......
......@@ -83,6 +83,25 @@ describe SMSBeholder do
expect(last_response.body).to include("what is the solution?\n1) Six\n2) Sixteen\n3) I wasn't paying attention")
end
it 'shows constant selections from conditional selection set' do
get '/', From: 'Dude', SkipToState: 'M00'
expect(last_response.body).to include("1) How do you like soccer?\n2) Do you like dancing?")
end
# it 'hides conditional selection without condition' do
# get '/', From: 'Dude', SkipToState: 'M00'
# expect(last_response.body).not_to include("that killer bicycle kick")
# end
# it 'hides conditional selection with failed condition' do
# get '/', From: 'Dude', SkipToState: 'M00', SetKey: 'mox-kick', SetKeyValue: 'unknown'
# expect(last_response.body).to include("1) How do you like soccer?\n2) Do you like dancing?")
# expect(last_response.body).not_to include("that killer bicycle kick")
# end
# it 'can be played all the way through' do
# get '/', From: 'Dude'
# Timeout::timeout(10) do
......
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