94 lines
2.7 KiB
Ruby
94 lines
2.7 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe "Home Screen", :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, :show_whats_next => true) }
|
|
|
|
|
|
describe "in normal browser" do
|
|
before(:each) do
|
|
sign_in_poltergeist user
|
|
visit "/client"
|
|
should have_selector('h1', text: 'getting started')
|
|
end
|
|
|
|
it "should show launch app dialog if clicked setup gear" do
|
|
find('#getting-started-dialog .setup-gear-btn').trigger('click')
|
|
should have_selector('p', text: 'To configure your audio gear, you must use the JamKazam application.')
|
|
end
|
|
end
|
|
|
|
describe "in native client" do
|
|
|
|
before(:each) do
|
|
sign_in_poltergeist user
|
|
emulate_client
|
|
visit "/client"
|
|
should have_selector('h1', text: 'getting started')
|
|
end
|
|
|
|
describe "new user in the native view should see the getting started dialog" do
|
|
|
|
it "should show gear page if clicked setup gear" do
|
|
find('#getting-started-dialog .setup-gear-btn').trigger('click')
|
|
should have_selector('.ftue-step-title', text: 'Understand Your Gear')
|
|
end
|
|
|
|
describe "open invitation dialog for email" do
|
|
before(:each) do
|
|
find('#getting-started-dialog .email-invite').trigger(:click)
|
|
end
|
|
|
|
it {should have_selector('label', text: 'Enter email address(es). If multiple addresses, separate with commas.')}
|
|
end
|
|
|
|
|
|
describe "launches youtube tutorial site" do
|
|
|
|
it {
|
|
find("#getting-started-dialog a[purpose='youtube-tutorials']").trigger(:click)
|
|
page.driver.window_handles.last
|
|
page.within_window page.driver.window_handles.last do
|
|
should have_title('JamKazam - YouTube')
|
|
end
|
|
}
|
|
end
|
|
|
|
|
|
describe "close hides the screen" do
|
|
|
|
it {
|
|
find('#getting-started-dialog a[layout-action="close"]').trigger(:click)
|
|
should have_no_selector('h1', text: 'getting started')
|
|
}
|
|
end
|
|
|
|
describe "user can make prompt go away forever" do
|
|
|
|
it {
|
|
find('#getting-started-dialog ins.iCheck-helper').trigger(:click)
|
|
find('#getting-started-dialog a[layout-action="close"]').trigger(:click)
|
|
|
|
# needed because we poke the server with an updateUser call, but their is no indication in the UI that it's done
|
|
wait_for_ajax
|
|
emulate_client
|
|
sleep 1
|
|
visit "/client"
|
|
wait_until_curtain_gone
|
|
should_not have_selector('h1', text: 'getting started')
|
|
}
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
|