Sha256: a72b87ea719738f12d3f7a3814472ab96ab64a2fc0966d3fafccdb7ec8fe4397

Contents?: true

Size: 1.43 KB

Versions: 15

Compression:

Stored size: 1.43 KB

Contents

require 'spec_helper'
require 'capybara/rspec'
require 'capybara-webkit'

describe 'a browser', :js => true do
  sequence = 'ATCGATCAGCTACGATCAGCATCGACTAGCATCGACTACGA'
  sample_nucl_db = 'Sinvicta2-2-3.cdna.subset.fasta'
  # 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)
  end

  it 'runs a simple blastn search' do
    visit '/'
    fill_in('sequence', :with => sequence)
    check(sample_nucl_db)
    click_button('method')
    page.should have_content('Query')
  end

  it 'properly controls blast button' do
    visit '/'

    fill_in('sequence', :with => sequence)
    page.evaluate_script("$('#method').is(':disabled')").should eq(true)

    check(sample_nucl_db)
    page.evaluate_script("$('#method').is(':disabled')").should eq(false)
  end

  it 'properly controls interaction with database listing' do
    visit '/'
    fill_in('sequence', :with => sequence)
    check(sample_nucl_db)
    page.evaluate_script("$('.protein .checkbox').first().hasClass('disabled')")
      .should eq(true)
  end

  it 'shows a dropdown menu when other blast methods are available' do
    visit '/'
    fill_in('sequence', :with => sequence)
    check(sample_nucl_db)
    page.save_screenshot('screenshot.png')
    page.has_css?('button.dropdown-toggle').should eq(true)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sequenceserver-1.0.14 spec/capybara_spec.rb
sequenceserver-1.0.13 spec/capybara_spec.rb
sequenceserver-1.0.12 spec/capybara_spec.rb
sequenceserver-1.0.11 spec/capybara_spec.rb
sequenceserver-1.0.10 spec/capybara_spec.rb
sequenceserver-1.0.9 spec/capybara_spec.rb
sequenceserver-1.0.8 spec/capybara_spec.rb
sequenceserver-1.0.7 spec/capybara_spec.rb
sequenceserver-1.0.6 spec/capybara_spec.rb
sequenceserver-1.0.5 spec/capybara_spec.rb
sequenceserver-1.0.4 spec/capybara_spec.rb
sequenceserver-1.0.3 spec/capybara_spec.rb
sequenceserver-1.0.2 spec/capybara_spec.rb
sequenceserver-1.0.1 spec/capybara_spec.rb
sequenceserver-1.0.0 spec/capybara_spec.rb