---
Tried to extract the javascript snippets in searchbar to an external js file, but failed miserably as it is too mixed up.
Running all tests make the following error show up
/usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop' ODDB::View::Drugs::PrescriptionPrintInnerComposite::COMPONENTS[[0, 1]] in create(name) ODDB::View::Drugs::PrescriptionPrintComposite::COMPONENTS[[0, 8]] in create(document) ODDB::View::Drugs::PrescriptionPrint::COMPONENTS[[0, 1]] in create(content) InteractionChooserDrug.url http://oddb-ci2.dyndns.org/de/gcc/home_interactions/zsr_P006309 InteractionChooserDrug.url http://oddb-ci2.dyndns.org/de/gcc/home_interactions/zsr_P006309 InteractionChooserDrug.url http://oddb-ci2.dyndns.org/de/gcc/home_interactions/zsr_P006309 error in SBSM::Session#http_headers: /de/gcc/print/prescription/zsr_P006309/ean/7680583920112/7680390530474/7680586430045/7680576730049/7680552240258/7680588680028/7680517560100/7680587340015/7680352630396/7680480880748 NoMethodError undefined method `name' for []:Array /var/www/oddb.org/src/model/package.rb:193:in `company_name' /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' /var/www/oddb.org/src/view/drugs/prescription.rb:416:in `name' /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create' /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component' error in SBSM::Session#to_html: /de/gcc/search/zone/drugs/search_query/Aspirin/search_type/st_oddb? NoMethodError undefined method `listed?' for []:Array
As the package 7680576730049 throws the error NoMethodError undefined method `name' for []:Array
But I have now problems that changing the ZSR-ID does not trigger an update. Found the changes in one of my aborted changesets. Now things look better.
The watir tests are quite comprehensive and make me discover always that there are many interactions betweent the different parts of our work as the instant searchbar is used in so many different views. Therefore it was way too easy to change a little thing in the searchbar and to break stuff in the interactions or the prescription.
Export to CSV does not work. Looks like for printing we set the correct request_path, whereas I don't know yet how to specify the request-path for the the CSV. Here the relevant snippet from src/view/drugs/prescription.rb
print.onclick = "window.open('#{new_url}');" buttons << print buttons << ' ' buttons << post_event_button(:export_csv)
Pushed commit Fix prescription ZSR-id and interaction. I still have the following three watir failures:
I think all correspond to known deficiencies or may be even a false warning (ch.oddb.org should save zsr in preferences).