require 'spec_helper'

# this test currently amounts to the barest of smoke tests; log in, see the home screen, and click a tile
# https://jamkazam.atlassian.net/browse/VRFS-749 broke even this simple functionality
describe "Admin", :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_max_wait_time = 10
  end

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

  before(:each) do
    UserMailer.deliveries.clear
    sign_in_poltergeist user
    visit "/client"
    find('h2', text: 'musicians')
  end

  describe "click musician tile" do

    before(:each) do
      find("div.homecard.musicians").trigger(:click)
    end

    it { should have_selector('h1', text: 'musicians' ) }
  end
end

