|
178 | 178 | end |
179 | 179 |
|
180 | 180 | it 'renders bootstrap switch button with additional custom class' do |
181 | | -# add additional custom class to bootstrap switch |
182 | | - |
183 | | -# form_config = get_form_config(path: switch_success_form_test_path) |
184 | | -# matestack_render do |
185 | | -# matestack_form form_config do |
186 | | -# bs_form_switch key: :foo, options: [1, 2], class: "some-class" |
187 | | -# bs_form_submit text: "Submit" |
188 | | -# end |
189 | | -# end |
190 | | -# visit example_path |
191 | | -# expect(page).to have_xpath('//form//switch[@id="foo" and contains(@class, "form-switch") and contains(@class, "some-class")]') |
| 181 | + |
| 182 | + # add additional custom class to bootstrap switch |
| 183 | + form_config = get_form_config(path: switch_success_form_test_path) |
| 184 | + matestack_render do |
| 185 | + matestack_form form_config do |
| 186 | + bs_form_switch key: :foo, options: [1, 2], class: "some-class" |
| 187 | + bs_form_submit text: "Submit" |
| 188 | + end |
| 189 | + end |
| 190 | + visit example_path |
| 191 | + # expect(page).to have_xpath('//form//switch[@id="foo_1" and contains(@class, "form-switch") and contains(@class, "some-class")]') |
| 192 | + expect(page).to have_xpath('//form//input[@id="foo_1" and contains(@class, "some-class")]') |
| 193 | + expect(page).to have_xpath('//form//input[@id="foo_2" and contains(@class, "some-class")]') |
192 | 194 | end |
193 | 195 |
|
194 | 196 | it 'renders disabled bootstrap switch buttons' do |
|
200 | 202 | end |
201 | 203 | end |
202 | 204 | visit example_path |
203 | | - have_xpath('//form//input[@id="_1" and @disabled="disabled" and contains(@class, "is-invalid")]') |
204 | | - have_xpath('//form//input[@id="_2" and @disabled="disabled" and contains(@class, "is-invalid")]') |
| 205 | + expect(page).to have_xpath('//form//input[@id="foo_1" and @disabled="disabled"]') |
| 206 | + expect(page).to have_xpath('//form//input[@id="foo_2" and @disabled="disabled"]') |
205 | 207 | end |
206 | 208 |
|
207 | 209 | it 'renders bootstrap switch button with label' do |
|
0 commit comments