@@ -243,7 +243,7 @@ class ExamplePage < Matestack::Ui::Page
243243 def response
244244 form form_config , :include do
245245 form_select id : "my-array-test-dropdown" , key : :array_input , type : :dropdown , options : [ "Array Option 1" , "Array Option 2" ]
246- form_select id : "my-hash-test-dropdown" , key : :hash_input , type : :dropdown , options : { "1" : " Hash Option 1", "2" : " Hash Option 2" }
246+ form_select id : "my-hash-test-dropdown" , key : :hash_input , type : :dropdown , options : { "Hash Option 1" : 1 , "Hash Option 2" : 2 }
247247 form_submit do
248248 button text : "Submit me!"
249249 end
@@ -267,7 +267,7 @@ def form_config
267267 select "Array Option 2" , from : "my-array-test-dropdown"
268268 select "Hash Option 2" , from : "my-hash-test-dropdown"
269269 expect_any_instance_of ( FormTestController ) . to receive ( :expect_params )
270- . with ( hash_including ( my_object : { array_input : "Array Option 2" , hash_input : "2" } ) )
270+ . with ( hash_including ( my_object : { array_input : "Array Option 2" , hash_input : 2 } ) )
271271 click_button "Submit me!"
272272 end
273273
@@ -276,7 +276,7 @@ class ExamplePage < Matestack::Ui::Page
276276 def response
277277 form form_config , :include do
278278 form_select id : "my-array-test-dropdown" , key : :array_input , type : :dropdown , options : [ "Array Option 1" , "Array Option 2" ] , init : "Array Option 1"
279- form_select id : "my-hash-test-dropdown" , key : :hash_input , type : :dropdown , options : { "1" : " Hash Option 1", "2" : " Hash Option 2" } , init : "1"
279+ form_select id : "my-hash-test-dropdown" , key : :hash_input , type : :dropdown , options : { "Hash Option 1" : 1 , "Hash Option 2" : 2 } , init : 1
280280 form_submit do
281281 button text : "Submit me!"
282282 end
@@ -297,11 +297,11 @@ def form_config
297297
298298 visit "/example"
299299 expect ( page ) . to have_field ( "my-array-test-dropdown" , with : "Array Option 1" )
300- expect ( page ) . to have_field ( "my-hash-test-dropdown" , with : "1" )
300+ expect ( page ) . to have_field ( "my-hash-test-dropdown" , with : 1 )
301301 select "Array Option 2" , from : "my-array-test-dropdown"
302302 select "Hash Option 2" , from : "my-hash-test-dropdown"
303303 expect_any_instance_of ( FormTestController ) . to receive ( :expect_params )
304- . with ( hash_including ( my_object : { array_input : "Array Option 2" , hash_input : "2" } ) )
304+ . with ( hash_including ( my_object : { array_input : "Array Option 2" , hash_input : 2 } ) )
305305 click_button "Submit me!"
306306 end
307307
@@ -322,7 +322,7 @@ def response
322322 form form_config , :include do
323323 form_input id : "description" , key : :description , type : :text
324324 # TODO: Provide better Enum Options API
325- form_select id : "status" , key : :status , type : :dropdown , options : TestModel . statuses . invert , init : TestModel . statuses [ @test_model . status ]
325+ form_select id : "status" , key : :status , type : :dropdown , options : TestModel . statuses , init : TestModel . statuses [ @test_model . status ]
326326 form_submit do
327327 button text : "Submit me!"
328328 end
@@ -368,7 +368,7 @@ def response
368368 form form_config , :include do
369369 form_input id : "description" , key : :description , type : :text
370370 # TODO: Provide better Enum Options API
371- form_select id : "status" , key : :status , type : :dropdown , options : TestModel . statuses . invert , init : TestModel . statuses [ @test_model . status ]
371+ form_select id : "status" , key : :status , type : :dropdown , options : TestModel . statuses , init : TestModel . statuses [ @test_model . status ]
372372 form_submit do
373373 button text : "Submit me!"
374374 end
@@ -413,7 +413,7 @@ def prepare
413413 def response
414414 form form_config , :include do
415415 # TODO: Provide better Enum Options API
416- form_select id : "status" , key : :status , type : :dropdown , options : TestModel . statuses . invert , init : TestModel . statuses [ @test_model . status ]
416+ form_select id : "status" , key : :status , type : :dropdown , options : TestModel . statuses , init : TestModel . statuses [ @test_model . status ]
417417 form_submit do
418418 button text : "Submit me!"
419419 end
@@ -445,7 +445,7 @@ class ExamplePage < Matestack::Ui::Page
445445 def response
446446 form form_config , :include do
447447 form_select id : "my-array-test-dropdown" , key : :array_input , type : :dropdown , options : [ "Array Option 1" , "Array Option 2" ] , class : "form-control"
448- form_select id : "my-hash-test-dropdown" , key : :hash_input , type : :dropdown , options : { "1" : " Hash Option 1", "2" : " Hash Option 2" } , class : "form-control"
448+ form_select id : "my-hash-test-dropdown" , key : :hash_input , type : :dropdown , options : { "Hash Option 1" : 1 , "Hash Option 2" : 2 } , class : "form-control"
449449 form_submit do
450450 button text : "Submit me!"
451451 end
0 commit comments