From d94388161c9f7baeeeb443976887bf4fd6df0971 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 24 Apr 2015 12:09:22 -0500 Subject: [PATCH] * fixing recording-based tests and one checkout test --- web/app/assets/javascripts/jamkazam.js | 1 + web/app/assets/javascripts/shopping_cart.js | 20 +++++++++++-------- .../_recordingFinishedDialog.html.haml | 4 ++-- web/spec/features/checkout_spec.rb | 4 ++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/web/app/assets/javascripts/jamkazam.js b/web/app/assets/javascripts/jamkazam.js index 6b52d5afe..d1b41d451 100644 --- a/web/app/assets/javascripts/jamkazam.js +++ b/web/app/assets/javascripts/jamkazam.js @@ -353,6 +353,7 @@ userDeferred = new $.Deferred(); userDeferred.reject('not_logged_in'); } + return userDeferred; } this.activeElementEvent = function(evtName, data) { diff --git a/web/app/assets/javascripts/shopping_cart.js b/web/app/assets/javascripts/shopping_cart.js index 7a80d5d2b..a3166b6fa 100644 --- a/web/app/assets/javascripts/shopping_cart.js +++ b/web/app/assets/javascripts/shopping_cart.js @@ -29,18 +29,22 @@ function proceedCheckout(e) { e.preventDefault(); + logger.debug("proceedCheckout") if (!context.JK.currentUserId) { + logger.debug("proceeding to signin screen because there is no user") window.location = '/client#/checkoutSignin'; } else { - app.user().done(function(user) { - if(user.has_recurly_account && user.reuse_card) { - window.location = '/client#/checkoutOrder'; - } - else { - window.location = '/client#/checkoutPayment'; - } - }) + var user = app.currentUser(); + + if(user.has_recurly_account && user.reuse_card) { + logger.debug("proceeding to checkout order screen because we have card info already") + window.location = '/client#/checkoutOrder'; + } + else { + logger.debug("proceeding to checkout payment screen because we do not have card info") + window.location = '/client#/checkoutPayment'; + } } } diff --git a/web/app/views/dialogs/_recordingFinishedDialog.html.haml b/web/app/views/dialogs/_recordingFinishedDialog.html.haml index 66e1cffa2..aa8c7e2d2 100644 --- a/web/app/views/dialogs/_recordingFinishedDialog.html.haml +++ b/web/app/views/dialogs/_recordingFinishedDialog.html.haml @@ -25,11 +25,11 @@ %textarea#claim-recording-description.w100{:name => "description"} -if (Rails.application.config.video_available=="full") || (current_user && current_user.admin) .field.left{:purpose => "save_video"} - %input{:checked => "checked", :name => "save_video", :type => "checkbox"}/ + %input{:name => "save_video", :type => "checkbox"}/ %label{:for => "save_video"} Save Video to Computer .field.left{:purpose => "upload_to_youtube"} %span - %input{:checked => "checked", :name => "upload_to_youtube", :type => "checkbox"}/ + %input{:name => "upload_to_youtube", :type => "checkbox"}/ %label{:for => "upload_to_youtube"} Upload Video to YouTube %span = render(:partial => "shared/google_login") diff --git a/web/spec/features/checkout_spec.rb b/web/spec/features/checkout_spec.rb index b1d149d9c..56a363041 100644 --- a/web/spec/features/checkout_spec.rb +++ b/web/spec/features/checkout_spec.rb @@ -550,7 +550,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d find('.thanks-detail.jam-tracks-in-browser') # find the 'go download jamkazam button' that shows if your first_download_client_at is null find('.thanks-detail .download-jamkazam-wrapper').trigger(:click) - find('.click-to-download', text: 'Click the button below to download the JamKazam application installer.') + find('.download-jamkazam', text: 'Click Here to Get the Free JamKazam Application') acdc = jamtrack_acdc_backinblack.right_for_user(user) @@ -714,7 +714,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d # should be taken straight to order page - # now see order page, and everything should appear free + # now see order page, and everything should no longer appear free find('p.order-prompt') find('.order-items-value.order-total', text:'$1.99') find('.order-items-value.shipping-handling', text:'$0.00')