<commit_before>require 'rails_helper'
require 'pry'

# Feature: Search
feature "Search Feature", type: :feature, js: true do
  background do
    # Given I am on the home page
    visit root_path
    using_wait_time 10 do
      expect(page).to have_css('div.overlay-wrapper div.overlay')
      div = find('div.overlay-wrapper div.overlay')
      expect(div).to have_xpath('//button')
      div.find('button').click
      # And search field is rendered with ember.js
      expect(page).to have_css('div#wheelmap div.ember-view')
    end
  end

  describe "Simple search" do
    # Given a search for "Herborn" delivers the following results
    let(:search_result) { FactoryGirl.create(
      search_result =
        [
          "place_id":"116998025",
          "licence":"Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.",
          "osm_type":"relation",
          "osm_id":"1245136",
          "boundingbox":["49.6095492813","49.9295492813","7.12593639533","7.44593639533"],
          "lat":"49.7695492812658","lon":"7.2859363953348",
          "display_name":"<NAME>, Birkenfeld, Rheinland-Pfalz, Deutschland",
          "class":"boundary",
          "type":"administrative",
          "icon":"http://open.mapquestapi.com/nominatim/v1/images/mapicons/poi_boundary_administrative.p.20.png"
        ]
    )}

    let(:search_input) { FactoryGirl.create(:css, 'div.input-append') }

    # And I search for "Herborn"
    it "is possible to search for 'Herborn'" do
      expect(page).to have_css('input#search')
      search = find(:css, 'input#search')
      search.set('herborn')
      expect(search.value).to eq('herborn')
      click_button('Finden')

      # Then I should be on the search result page
      expect(page.current_url).to end_with('/search?q=herborn')
    end
  end
end<commit_msg>Remove unused search_result & search_input from search_spec<commit_after>require 'rails_helper'

# Feature: Search
feature "Search Feature", type: :feature, js: true do
  background do
    # Given I am on the home page
    visit root_path
    using_wait_time 10 do
      expect(page).to have_css('div.overlay-wrapper div.overlay')
      div = find('div.overlay-wrapper div.overlay')
      expect(div).to have_xpath('//button')
      div.find('button').click
      # And search field is rendered with ember.js
      expect(page).to have_css('div#wheelmap div.ember-view')
    end
  end

  describe "Simple search" do
    # And I search for "Herborn"
    it "is possible to search for 'Herborn'" do
      expect(page).to have_css('input#search')
      search = find(:css, 'input#search')
      search.set('herborn')
      expect(search.value).to eq('herborn')
      click_button('Finden')

      # Then I should be on the search result page
      expect(page.current_url).to end_with('/search?q=herborn')
    end
  end
end
{'fraction_non_alphanumeric': 0.12851123595505617, 'fraction_numerical': 0.03581460674157303, 'mean_word_length': 3.1470160116448325, 'pattern_counts': {'":': 11, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '95711', 'n_tokens_mistral': 961, 'n_tokens_neox': 889, 'n_words': 216}