40 lines
1.0 KiB
Ruby
40 lines
1.0 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe "Musician Search", :js => true, :type => :feature, :capybara_feature => true do
|
|
|
|
subject { page }
|
|
|
|
let(:user) { FactoryGirl.create(:user) }
|
|
|
|
before(:all) do
|
|
poltergeist_setup
|
|
end
|
|
|
|
before(:each) do
|
|
sign_in_poltergeist user
|
|
visit "/client#/musicians"
|
|
end
|
|
|
|
it "shows the musician search page" do
|
|
expect(page).to have_selector('#find-musician-form')
|
|
end
|
|
|
|
it "shows search results" do
|
|
expect(page).to have_selector('#musician-filter-results .musician-list-result')
|
|
end
|
|
|
|
it "shows submits query" do
|
|
expect(page).to have_selector('#musician-filter-results .musician-list-result')
|
|
end
|
|
|
|
it "shows blank result set" do
|
|
wait_for_easydropdown('#musician_instrument')
|
|
# get the 2nd option from the instruments list
|
|
text = find('#musician_instrument', :visible => false).find(:xpath, 'option[2]', :visible => false).text
|
|
# and select it
|
|
jk_select(text, '#musician_instrument')
|
|
expect(page).to_not have_selector('#musician-filter-results .musician-list-result')
|
|
end
|
|
|
|
end
|