Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion spec/features/inputs/nested_select_input_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@

it "shows filled select controls based on defined city_id", js: true do
on_input_ctx("invoice_country") { expect_slimselect_selection("Chile") }
on_input_ctx("invoice_region") { expect_slimselect_selection("Metropolitana") }
on_input_ctx("invoice_region") do
expect_slimselect_selection("Metropolitana")
expect_slimselect_option("Antofagasta")
expect_slimselect_option("Cuyo")
end
on_input_ctx("invoice_city") { expect_slimselect_selection("Santiago") }
end

Expand Down
4 changes: 4 additions & 0 deletions spec/support/capybara_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ def expect_slimselect_empty_selection
expect(page).to have_css(".ss-main", text: /Select Value/)
end

def expect_slimselect_option(text)
expect(page).to have_css(".ss-option", text: /#{text}/)
end

def expect_slimselect_result_text_to_eq(result_number, text)
expect(page).to have_css(
"div.ss-option:nth-child(#{result_number})", text: /#{text}/
Expand Down