diff --git a/app/views/component/search/_aside.html.haml b/app/views/component/search/_aside.html.haml index ab98efbf7..458584d17 100644 --- a/app/views/component/search/_aside.html.haml +++ b/app/views/component/search/_aside.html.haml @@ -1,5 +1,7 @@ %aside#search-container %section#search-box + = form_tag('/organizations', :method => :get, :id=>"location-form") do + = hidden_field_tag 'location' = form_tag('/organizations', :method => :get, :id=>"search-form") do %section#keyword-search-box %div diff --git a/app/views/component/search/_filter.html.haml b/app/views/component/search/_filter.html.haml index cd5c392f2..30488ebde 100644 --- a/app/views/component/search/_filter.html.haml +++ b/app/views/component/search/_filter.html.haml @@ -52,7 +52,7 @@ %label{:for => "#{css_field}-option-1",:id => "#{css_field}-option-1-label"} %span{:class=>(add_is_checked ? "hide" : "")} Other... - = search_field_tag field, (add_is_checked ? params[field] : ""), :class=>(add_is_checked ? "" : "hide"),:list=>"#{css_field}-list",:placeholder=>"#{add_placeholder}" + = search_field_tag field, (add_is_checked ? params[field] : ""), id: "#{css_field}-option-input", :class=>(add_is_checked ? "" : "hide"),:list=>"#{css_field}-list",:placeholder=>"#{add_placeholder}" - elsif add_input_type == "SELECT" - add_is_checked = (all_is_checked == false && toggle_is_checked == false) %div.toggle-group-wrapper.add @@ -65,7 +65,7 @@ %label{:for => "#{css_field}-option-1",:id => "#{css_field}-option-1-label"} %span{:class=>(add_is_checked ? "hide" : "")} Other... - = select_tag(field, options_for_select(list_values, selected: :option )) + = select_tag field, options_for_select(list_values, selected: :option ), id: "#{css_field}-option-input" - toggle_is_checked = false - length = aggregate_field.length-1 @@ -85,7 +85,7 @@ %label{:for => "#{css_field}-option-#{i+2}",:id => "#{css_field}-option-#{i+2}-label"} = field_display - = hidden_field_tag field, field_value, id: "#{css_field}-hidden" + = hidden_field_tag field, field_value - if css_field == "location" %div#geolocate-box diff --git a/spec/features/search/filters_spec.rb b/spec/features/search/filters_spec.rb index 7818e0986..724ed3b48 100644 --- a/spec/features/search/filters_spec.rb +++ b/spec/features/search/filters_spec.rb @@ -64,7 +64,7 @@ within("#location-options") do find(".closed").trigger('mousedown') expect(find(".available-options")).to have_css(".toggle-group", :count => 2) - expect(find_by_id("location").value).to eq "San Mateo, CA" + expect(find_by_id("location-option-input").value).to eq "San Mateo, CA" end end @@ -75,7 +75,7 @@ within("#org-name-options") do find(".closed").trigger('mousedown') expect(find(".available-options")).to have_css(".toggle-group", :count => 2) - expect(find_by_id("org_name").value).to eq "United States Government" + expect(find_by_id("org-name-option-input").value).to eq "United States Government" end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b0d4a29db..636eef785 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -21,17 +21,17 @@ end # To debug failures of javascript-enabled tests, you can add ":debug => true" -# as an additional option on line 16. For example: +# as an additional option on line 20. For example: # Capybara::Poltergeist::Driver.new(app, :js_errors => true, :debug => true) # This will result in verbose output in the Terminal when running tests. # You can also use Poltergeist's experimental remote debugging feature by -# replacing line 15-17 with: +# replacing line 19-21 with: # Capybara.register_driver :poltergeist_debug do |app| # Capybara::Poltergeist::Driver.new(app, :inspector => true) # end # You will also need to add Capybara.javascript_driver = :poltergeist_debug -# on line 42. Add "page.driver.debug" at a spot where you want to pause a test. +# on line 45. Add "page.driver.debug" at a spot where you want to pause a test. # When you run the test, it will pause at that spot, and will launch a browser # window where you can inspect the page contents. # Remember to remove "page.driver.debug" when you're done debugging!