|
60 | 60 | expect(page).to have_text(/Billing Address/i) |
61 | 61 | expect(page).to have_text(/Shipping Address/i) |
62 | 62 |
|
63 | | - str_addr = 'bill_address' |
64 | | - select 'United States', from: "order_#{str_addr}_attributes_country_id" |
65 | | - %w(firstname lastname address1 city zipcode phone).each do |field| |
66 | | - fill_in "order_#{str_addr}_attributes_#{field}", with: address.send(field).to_s |
67 | | - end |
68 | | - select address.state.name.to_s, from: "order_#{str_addr}_attributes_state_id" |
69 | | - check 'order_use_billing' |
70 | | - |
| 63 | + fill_addresses_fields_with(address) |
71 | 64 | click_button 'Save and Continue' |
| 65 | + |
72 | 66 | click_button 'Save and Continue' |
73 | 67 | click_button 'Save and Continue' |
74 | 68 | click_button 'Place Order' |
|
92 | 86 |
|
93 | 87 | click_button 'Checkout' |
94 | 88 |
|
95 | | - str_addr = 'bill_address' |
96 | | - select 'United States', from: "order_#{str_addr}_attributes_country_id" |
97 | | - %w(firstname lastname address1 city zipcode phone).each do |field| |
98 | | - fill_in "order_#{str_addr}_attributes_#{field}", with: address.send(field).to_s |
99 | | - end |
100 | | - select address.state.name.to_s, from: "order_#{str_addr}_attributes_state_id" |
101 | | - check 'order_use_billing' |
102 | | - |
| 89 | + fill_addresses_fields_with(address) |
103 | 90 | click_button 'Save and Continue' |
| 91 | + |
104 | 92 | click_button 'Save and Continue' |
105 | 93 | click_button 'Save and Continue' |
106 | 94 | click_button 'Place Order' |
|
134 | 122 | click_link 'Cart' |
135 | 123 | click_button 'Checkout' |
136 | 124 |
|
137 | | - str_addr = 'bill_address' |
138 | | - select 'United States', from: "order_#{str_addr}_attributes_country_id" |
139 | | - %w(firstname lastname address1 city zipcode phone).each do |field| |
140 | | - fill_in "order_#{str_addr}_attributes_#{field}", with: address.send(field).to_s |
141 | | - end |
142 | | - select address.state.name.to_s, from: "order_#{str_addr}_attributes_state_id" |
143 | | - check 'order_use_billing' |
144 | | - |
| 125 | + fill_addresses_fields_with(address) |
145 | 126 | click_button 'Save and Continue' |
146 | 127 |
|
147 | 128 | expect(page).not_to have_text 'Email is invalid' |
|
163 | 144 |
|
164 | 145 | expect(page).to have_text 'You have signed up successfully.' |
165 | 146 |
|
166 | | - str_addr = 'bill_address' |
167 | | - select 'United States', from: "order_#{str_addr}_attributes_country_id" |
168 | | - %w(firstname lastname address1 city zipcode phone).each do |field| |
169 | | - fill_in "order_#{str_addr}_attributes_#{field}", with: address.send(field).to_s |
170 | | - end |
171 | | - select address.state.name.to_s, from: "order_#{str_addr}_attributes_state_id" |
172 | | - check 'order_use_billing' |
173 | | - |
| 147 | + fill_addresses_fields_with(address) |
174 | 148 | click_button 'Save and Continue' |
| 149 | + |
175 | 150 | click_button 'Save and Continue' |
176 | 151 | click_button 'Save and Continue' |
177 | 152 | click_button 'Place Order' |
|
0 commit comments