2013-10-01 18:57:02 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
|
|
# these test will verify all of the user progression cases that rely on a javascript event (not bothering with instrumented models)
|
|
|
|
|
|
|
|
|
|
describe "User Progression", :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) }
|
|
|
|
|
|
|
|
|
|
describe "downloaded client" do
|
|
|
|
|
|
2013-10-01 20:20:33 +00:00
|
|
|
before(:each) do
|
|
|
|
|
FactoryGirl.create(:artifact_update, :product => 'JamClient/Win32')
|
|
|
|
|
FactoryGirl.create(:artifact_update, :product => 'JamClient/MacOSX')
|
|
|
|
|
end
|
|
|
|
|
|
2013-10-20 04:45:43 +00:00
|
|
|
# right after you signup as a musician, you are downloaded to a page that lets you download the client.
|
2013-10-01 20:20:33 +00:00
|
|
|
describe "post-signup" do
|
|
|
|
|
before do
|
|
|
|
|
visit signup_path
|
|
|
|
|
fill_in "jam_ruby_user[first_name]", with: "Mike"
|
|
|
|
|
fill_in "jam_ruby_user[last_name]", with: "Jones"
|
2013-10-21 16:13:00 +00:00
|
|
|
fill_in "jam_ruby_user[email]", with: "user_progression1@jamkazam.com"
|
2013-10-01 20:20:33 +00:00
|
|
|
fill_in "jam_ruby_user[password]", with: "jam123"
|
|
|
|
|
fill_in "jam_ruby_user[password_confirmation]", with: "jam123"
|
|
|
|
|
check("jam_ruby_user[instruments][drums][selected]")
|
|
|
|
|
check("jam_ruby_user[terms_of_service]")
|
|
|
|
|
click_button "CREATE ACCOUNT"
|
|
|
|
|
|
2013-10-19 19:46:06 +00:00
|
|
|
should have_content("You have successfully registered as a JamKazam musician.")
|
|
|
|
|
detected_os = find("a.current-os-download")['data-platform']
|
|
|
|
|
if detected_os != "Win32"
|
|
|
|
|
find(".download-others a[data-platform='Win32']").trigger(:click)
|
|
|
|
|
end
|
|
|
|
|
find("a.current-os-download").trigger(:click)
|
|
|
|
|
sleep 1 # it's really hard to know if the rest API completed after the click
|
2013-10-01 20:20:33 +00:00
|
|
|
end
|
|
|
|
|
|
2013-10-19 19:46:06 +00:00
|
|
|
it {
|
2013-10-21 16:13:00 +00:00
|
|
|
User.find_by_email('user_progression1@jamkazam.com').reload();
|
|
|
|
|
User.find_by_email('user_progression1@jamkazam.com').first_downloaded_client_at.should_not be_nil
|
2013-10-19 19:46:06 +00:00
|
|
|
}
|
2013-10-01 20:20:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
describe "downloads-page" do
|
|
|
|
|
|
|
|
|
|
# there is also a generic download pages
|
|
|
|
|
before(:each) do
|
|
|
|
|
sign_in_poltergeist user
|
2013-10-19 19:46:06 +00:00
|
|
|
|
2013-10-01 20:20:33 +00:00
|
|
|
visit '/downloads'
|
2013-10-19 19:46:06 +00:00
|
|
|
detected_os = find("a.current-os-download")['data-platform']
|
|
|
|
|
if detected_os != "Win32"
|
|
|
|
|
find(".download-others a[data-platform='Win32']").trigger(:click)
|
|
|
|
|
end
|
|
|
|
|
find("a.current-os-download").trigger(:click)
|
|
|
|
|
sleep 1 # it's really hard to know if the rest API completed after the click
|
2013-10-01 20:20:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it {user.reload(); user.first_downloaded_client_at.should_not be_nil }
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
2013-10-01 18:57:02 +00:00
|
|
|
end
|
|
|
|
|
|
2013-10-01 20:20:33 +00:00
|
|
|
describe "certified gear" do
|
|
|
|
|
before(:each) do
|
|
|
|
|
sign_in_poltergeist user
|
2013-10-22 17:38:21 +00:00
|
|
|
visit '/client#/account/audio'
|
2013-10-01 20:20:33 +00:00
|
|
|
find("div.account-audio a[data-purpose='add-profile']").trigger(:click)
|
2014-02-22 02:56:40 +00:00
|
|
|
jk_select('ASIO4ALL v2 - ASIO', 'div[layout-wizard-step="0"] select.select-audio-device')
|
|
|
|
|
find('#btn-ftue-2-save').trigger(:click)
|
2013-10-01 20:20:33 +00:00
|
|
|
sleep 1
|
|
|
|
|
end
|
2013-10-01 18:57:02 +00:00
|
|
|
|
2013-10-01 20:20:33 +00:00
|
|
|
it {user.reload(); user.first_certified_gear_at.should_not be_nil }
|
2013-10-01 18:57:02 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
describe "social promoted" do
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|