spec/capybara_spec.rb in sequenceserver-1.0.14 vs spec/capybara_spec.rb in sequenceserver-1.1.0.beta

- old
+ new

@@ -1,26 +1,26 @@ require 'spec_helper' -require 'capybara/rspec' -require 'capybara-webkit' +# Cause the test to fail if Capybara is not available +exit! unless $capybara_available + describe 'a browser', :js => true do sequence = 'ATCGATCAGCTACGATCAGCATCGACTAGCATCGACTACGA' - sample_nucl_db = 'Sinvicta2-2-3.cdna.subset.fasta' + sample_nucl_db = 'Sinvicta 2-2-3 cdna subset' # sample_prot_db = 'Sinvicta2-2-3.prot' - before(:all) do - Capybara.javascript_driver = :webkit - Capybara.default_wait_time = 5 - - options = { :database_dir => SequenceServer.root } - Capybara.app = SequenceServer.init(options) + before do + Capybara.app = SequenceServer.init + Capybara.javascript_driver = :selenium end it 'runs a simple blastn search' do visit '/' fill_in('sequence', :with => sequence) check(sample_nucl_db) click_button('method') + # switch to new window because link opens in new window + page.driver.browser.switch_to.window(page.driver.browser.window_handles.last) page.should have_content('Query') end it 'properly controls blast button' do visit '/'