Files
grecia/spec/components/sdg_management/relations/search_component_spec.rb
Javi Martín 5f3279b9db Extract search form component in SDG Management
We're going to add some JavaScript which affect this component, and IMHO
it will be easier to know the JavaScript affects this form if both have
their own separate file.
2021-01-28 13:41:23 +01:00

17 lines
517 B
Ruby

require "rails_helper"
describe SDGManagement::Relations::SearchComponent, type: :component do
describe "#goal_options" do
it "orders goals by code in the select" do
component = SDGManagement::Relations::SearchComponent.new(label: "Search proposals")
render_inline component
options = page.find("#goal_code").all("option")
expect(options[0]).to have_content "All goals"
expect(options[1]).to have_content "1. "
expect(options[17]).to have_content "17. "
end
end
end