@@ -113,11 +113,12 @@ def form_config
113
113
visit "/example"
114
114
115
115
fill_in "my-test-input" , with : "bar"
116
- click_button "Submit me!"
117
116
118
117
expect_any_instance_of ( FormTestController ) . to receive ( :expect_params )
119
118
. with ( hash_including ( my_object : { foo : "bar" } ) )
120
119
120
+ click_button "Submit me!"
121
+
121
122
end
122
123
123
124
it "Example 2 - Async submit request and clears inputs on success" do
@@ -527,7 +528,7 @@ def form_config
527
528
fill_in "password-input" , with : "secret"
528
529
fill_in "number-input" , with : 123
529
530
fill_in "textarea-input" , with : "Hello \n World!"
530
- click_button "Submit me!"
531
+
531
532
532
533
expect_any_instance_of ( FormTestController ) . to receive ( :expect_params )
533
534
. with ( hash_including (
@@ -540,6 +541,8 @@ def form_config
540
541
}
541
542
) )
542
543
544
+ click_button "Submit me!"
545
+
543
546
end
544
547
545
548
end
@@ -782,11 +785,11 @@ def form_config
782
785
783
786
select "Array Option 2" , from : "my-array-test-dropdown"
784
787
select "Hash Option 2" , from : "my-hash-test-dropdown"
785
- click_button "Submit me!"
786
788
787
789
expect_any_instance_of ( FormTestController ) . to receive ( :expect_params )
788
790
. with ( hash_including ( my_object : { array_input : "Array Option 2" , hash_input : "2" } ) )
789
791
792
+ click_button "Submit me!"
790
793
end
791
794
792
795
it "can be initialized with value" do
@@ -825,11 +828,11 @@ def form_config
825
828
826
829
select "Array Option 2" , from : "my-array-test-dropdown"
827
830
select "Hash Option 2" , from : "my-hash-test-dropdown"
828
- click_button "Submit me!"
829
831
830
832
expect_any_instance_of ( FormTestController ) . to receive ( :expect_params )
831
833
. with ( hash_including ( my_object : { array_input : "Array Option 2" , hash_input : "2" } ) )
832
834
835
+ click_button "Submit me!"
833
836
end
834
837
835
838
it "can be mapped to an Active Record Model Array Enum" do
@@ -1064,11 +1067,12 @@ def form_config
1064
1067
check "Hash Option 1"
1065
1068
check "Hash Option 2"
1066
1069
1067
- click_button "Submit me!"
1068
1070
1069
1071
expect_any_instance_of ( FormTestController ) . to receive ( :expect_params )
1070
1072
. with ( hash_including ( my_object : { array_input : [ "Array Option 2" ] , hash_input : [ "1" , "2" ] } ) )
1071
1073
1074
+ click_button "Submit me!"
1075
+
1072
1076
end
1073
1077
1074
1078
it "can be initialized by (multiple) item(s)" do
@@ -1102,10 +1106,11 @@ def form_config
1102
1106
1103
1107
visit "/example"
1104
1108
1105
- click_button "Submit me!"
1106
1109
1107
1110
expect_any_instance_of ( FormTestController ) . to receive ( :expect_params )
1108
1111
. with ( hash_including ( my_object : { array_input : [ "Array Option 1" , "Array Option 2" ] , hash_input : [ "2" ] } ) )
1112
+
1113
+ click_button "Submit me!"
1109
1114
1110
1115
end
1111
1116
@@ -1231,11 +1236,11 @@ def form_config
1231
1236
choose ( 'Array Option 2' )
1232
1237
choose ( 'Hash Option 1' )
1233
1238
1234
- click_button "Submit me!"
1235
1239
1236
1240
expect_any_instance_of ( FormTestController ) . to receive ( :expect_params )
1237
1241
. with ( hash_including ( my_object : { array_input : "Array Option 2" , hash_input : "1" } ) )
1238
1242
1243
+ click_button "Submit me!"
1239
1244
end
1240
1245
1241
1246
it "can be initialized by (multiple) item(s)" do
@@ -1274,11 +1279,11 @@ def form_config
1274
1279
expect ( page ) . to have_field ( 'Hash Option 1' , checked : false )
1275
1280
expect ( page ) . to have_field ( 'Hash Option 2' , checked : true )
1276
1281
1277
- click_button "Submit me!"
1278
1282
1279
1283
expect_any_instance_of ( FormTestController ) . to receive ( :expect_params )
1280
1284
. with ( hash_including ( my_object : { array_input : "Array Option 1" , hash_input : "2" } ) )
1281
1285
1286
+ click_button "Submit me!"
1282
1287
end
1283
1288
1284
1289
it "can be mapped to an Active Record Model Array Enum" do
@@ -1606,11 +1611,11 @@ def response
1606
1611
visit "/example"
1607
1612
1608
1613
fill_in "my-test-input" , with : "bar"
1609
- click_button "Submit me!"
1610
1614
1611
1615
expect_any_instance_of ( FormTestController ) . to receive ( :expect_params )
1612
1616
. with ( hash_including ( my_object : { foo : "bar" } ) )
1613
1617
1618
+ click_button "Submit me!"
1614
1619
end
1615
1620
end
1616
1621
0 commit comments