Skip to content

Commit

Permalink
Fix instant search
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed Jul 9, 2014
1 parent b261230 commit 5372365
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
18 changes: 5 additions & 13 deletions spec/rezept_and_instantsearch_spec.rb
Expand Up @@ -3,6 +3,8 @@
# kate: space-indent on; indent-width 2; mixedindent off; indent-mode ruby;
require 'spec_helper'
require 'pp'
require 'tmpdir'
require "selenium-webdriver"

describe "ch.oddb.org" do

Expand Down Expand Up @@ -47,13 +49,13 @@ def add_one_drug_to_rezept(name)

after :each do
@idx += 1
createScreenshot(@browser, '_'+@idx.to_s)
createScreenshot(@browser, '_'+@idx.to_s) if @browser
# sleep
@browser.goto OddbUrl
end

after :all do
@browser.close
@browser.close if @browser
end

Four_Medis = [ 'Losartan', 'Nolvadex', 'Paroxetin', 'Aspirin']
Expand Down Expand Up @@ -167,17 +169,7 @@ def add_one_drug_to_rezept(name)
next
end
}
@browser.send_keys("\n") # this is different to add_one_drug_to_rezept
@browser.send_keys("\n") # this is different to add_one_drug_to_rezept
idx = 0
while idx < 10
inhalt = @browser.text
break if inhalt.match(/Preisvergleich für/i)
sleep(1)
idx += 1
puts "Resending cr"
@browser.send_keys("\n") # this is different to add_one_drug_to_rezept
end
@browser.send_keys("\n")
url = @browser.url
inhalt = @browser.text
inhalt.should match(/Preisvergleich für/i)
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Expand Up @@ -18,7 +18,7 @@
require 'pp'

homeUrl ||= ENV['ODDB_URL']
homeUrl ||= "172.25.1.75"
homeUrl ||= "http://oddb-ci2.dyndns.org"
OddbUrl = homeUrl
ImageDest = File.join(Dir.pwd, 'images')
FileUtils.makedirs(ImageDest, :verbose => true) unless File.exists?(ImageDest)
Expand Down
3 changes: 1 addition & 2 deletions src/view/searchbar.rb
Expand Up @@ -222,8 +222,7 @@ def init
function selectSubmit() {
var popup = dojo.byId('#{id}_popup');
var searchbar = dojo.byId('#{id}');
if (popup && popup.style.overflowX.match(/auto/) && searchbar.value != '') {
#{progressbar}
if (popup && (popup.style.overflowX.match(/auto/) || popup.style.overflowX.match(/hidden/)) && searchbar.value != '') {
searchbar.form.submit();
}
}
Expand Down

0 comments on commit 5372365

Please sign in to comment.