Skip to content

Commit 8c490b6

Browse files
committed
adjusted disbled tests
added removed check for
1 parent f994edd commit 8c490b6

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

spec/test/form/checkbox_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@
203203
end
204204
end
205205
visit example_path
206-
have_xpath('//form//input[@id="foo_1" and @disabled="disabled" and contains(@class, "is-invalid")]')
207-
have_xpath('//form//input[@id="foo_2" and @disabled="disabled" and contains(@class, "is-invalid")]')
206+
expect(page).to have_xpath('//form//input[@id="foo_1" and @disabled="disabled"]')
207+
expect(page).to have_xpath('//form//input[@id="foo_2" and @disabled="disabled"]')
208208
end
209209

210210
it 'renders bootstrap checkbox button with label' do

spec/test/form/radio_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
expect(page).to have_selector('form > div.matestack-ui-bootstrap-radio > .form-check > label.form-check-label[for="foo_2"]')
3434

3535
find('#foo_1').click
36-
36+
3737
expect_any_instance_of(FormTestController).to receive(:expect_params)
3838
.with(hash_including(wrapper: { foo: 1 }))
3939

@@ -201,8 +201,8 @@
201201
end
202202
end
203203
visit example_path
204-
have_xpath('//form//input[@id="foo_1" and @disabled="disabled" and contains(@class, "is-invalid")]')
205-
have_xpath('//form//input[@id="foo_2" and @disabled="disabled" and contains(@class, "is-invalid")]')
204+
expect(page).to have_xpath('//form//input[@id="foo_1" and @disabled="disabled"]')
205+
expect(page).to have_xpath('//form//input[@id="foo_2" and @disabled="disabled"]')
206206
end
207207

208208
end

spec/test/form/switch_spec.rb

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,19 @@
178178
end
179179

180180
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")]')
192194
end
193195

194196
it 'renders disabled bootstrap switch buttons' do
@@ -200,8 +202,8 @@
200202
end
201203
end
202204
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"]')
205207
end
206208

207209
it 'renders bootstrap switch button with label' do

0 commit comments

Comments
 (0)