* VRFS-734 some tests for downloading

This commit is contained in:
Seth Call 2013-10-01 20:20:33 +00:00
parent ea1f6fb17b
commit 2e27773511
4 changed files with 62 additions and 10 deletions

View File

@ -43,8 +43,12 @@
var download = $(context._.template($('#client-download-link').html(), options, { variable: 'data' }));
download.find('a').data('platform', platform).click(function() {
rest.userDownloadedClient();
var clicked = $(this);
rest.userDownloadedClient().always(function() {
$('body').append('<iframe class="downloading" src="' + clicked.attr('href') + '" style="display:none"/>')
})
context.JK.GA.trackDownload($(this).data('platform'));
return false;
});
if(matchesUserOS) {

View File

@ -1,3 +1,3 @@
<script type="text/template" id="client-download-link">
<div align="center" class="client-download {{data.emphasis}}"><a href="{{data.uri}}" class="button-orange m0">DOWNLOAD JAMKAZAM SOFTWARE<br/><span class="platform">{{data.platform}}</span></a></div>
<div align="center" class="client-download {{data.emphasis}}"><a href="{{data.uri}}" class="button-orange m0">DOWNLOAD JAMKAZAM SOFTWARE<br/><span class="platform" platform="{{data.platform}}">{{data.platform}}</span></a></div>
</script>

View File

@ -15,9 +15,9 @@ describe "Find Session", :js => true, :type => :feature, :capybara_feature => tr
before(:each) do
UserMailer.deliveries.clear
sign_in_poltergeist user
visit "/#/findSession"
visit "/#/findSession"
find('#find-session-form')
find('#find-session-form')
end
# when the find session page loads, it should show that there are no sessions

View File

@ -12,19 +12,67 @@ describe "User Progression", :js => true, :type => :feature, :capybara_feature
Capybara.default_wait_time = 10
end
let(:user) { FactoryGirl.create(:user) }
before(:each) do
sign_in_poltergeist user
end
describe "downloaded client" do
before(:each) do
FactoryGirl.create(:artifact_update, :product => 'JamClient/Win32')
FactoryGirl.create(:artifact_update, :product => 'JamClient/MacOSX')
end
# right after you signup as a musician, you are downloaded to a page that let's you download the client.
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"
fill_in "jam_ruby_user[email]", with: "noone@jamkazam.com"
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"
should have_selector('.overlay-inner', text: "You have successfully registered as a JamKazam musician.")
first("div.client-download a").trigger(:click)
#find("body iframe.downloading")
sleep 1
end
it {User.find_by_email('noone@jamkazam.com').reload(); User.find_by_email('noone@jamkazam.com').first_downloaded_client_at.should_not be_nil }
end
describe "downloads-page" do
# there is also a generic download pages
before(:each) do
sign_in_poltergeist user
visit '/downloads'
first("div.client-download a").trigger(:click)
#find("body iframe.downloading")
sleep 1
end
it {user.reload(); user.first_downloaded_client_at.should_not be_nil }
end
end
describe "ran client" do
describe "certified gear" do
before(:each) do
sign_in_poltergeist user
visit '/#/account/audio'
find("div.account-audio a[data-purpose='add-profile']").trigger(:click)
find("a[layout-wizard-link='2']").trigger(:click) # NEXT
find("a[layout-wizard-link='3']").trigger(:click) # NEXT
find("a[layout-wizard-link='4']").trigger(:click) # START TEST
find("a[layout-action='close']").trigger(:click) # FINISH
sleep 1
end
it {user.reload(); user.first_certified_gear_at.should_not be_nil }
end
describe "social promoted" do