require 'spec_helper'

describe "Find Session", :js => true, :type => :feature, :capybara_feature => true do

  subject { page }

  before(:all) do
    Capybara.javascript_driver = :poltergeist
    Capybara.current_driver = Capybara.javascript_driver
    Capybara.default_wait_time = 10
  end

  let(:user) { FactoryGirl.create(:user) }

  before(:each) do
    UserMailer.deliveries.clear
    sign_in_poltergeist user
      visit "/#/findSession"

      find('#find-session-form')
  end

  # when the find session page loads, it should show that there are no sessions
  it { should have_selector('#sessions-none-found') }
end
