@@ -440,6 +463,7 @@ MIX_MODES = context.JK.MIX_MODES
e.preventDefault()
$target = $(e.target)
params = id: $target.attr('data-jamtrack-id')
+ params.variant = $target.attr('data-variant')
isFree = $(e.target).is('.is_free')
@rest.addJamtrackToShoppingCart(params).done((response) =>
@@ -475,6 +499,18 @@ MIX_MODES = context.JK.MIX_MODES
$parent.find('.jamtrack-add-cart').on 'click', @addToCartJamtrack
$parent.find('.license-us-why').on 'click', @licenseUSWhy
$parent.find('.jamtrack-detail-btn').on 'click', @toggleExpanded
+ $parent.find('.jamtrack-variant-help').on 'click', @showVariantHelp
+ $parent.find('.jamtrack-upgrade-help').on 'click', @showUpgradeHelp
+
+ showVariantHelp: (e) ->
+ $screen = $('#jamtrackSearch')
+ e.preventDefault()
+ context.JK.HelpBubbleHelper.jamtrackVariants($(e.target), $screen)
+
+ showUpgradeHelp: (e) ->
+ $screen = $('#jamtrackSearch')
+ e.preventDefault()
+ context.JK.HelpBubbleHelper.jamtrackUpgrade($(e.target), $screen)
toggleExpanded:(e) ->
e.preventDefault()
diff --git a/web/app/assets/javascripts/react-components/PopupJamTrackPlayer.js.jsx.coffee b/web/app/assets/javascripts/react-components/PopupJamTrackPlayer.js.jsx.coffee
index 6e158139e..2a5411a8f 100644
--- a/web/app/assets/javascripts/react-components/PopupJamTrackPlayer.js.jsx.coffee
+++ b/web/app/assets/javascripts/react-components/PopupJamTrackPlayer.js.jsx.coffee
@@ -592,6 +592,37 @@ mixins.push(Reflux.listenTo(UserStore, 'onUserChanged'))
# make this package the active one
JamTrackPlayerActions.openStem(selectedTrackId)
+ addUpgradeToCart: (jamtrack) ->
+ console.log("adding upgrade to cart")
+
+ params = {id: jamtrack.id, variant: 'download'}
+
+ rest.addJamtrackToShoppingCart(params).done((response) =>
+ console.log("added item to shopping cart. fast_redeem? " + response.fast_redeem)
+ if response.fast_reedem
+ if context.JK.currentUserId?
+ window.open('/client#/redeemComplete')
+ else
+ window.open('/client#/redeemSignup')
+ else
+ window.open('/client#/shoppingCart')
+
+ ).fail(((jqxhr) =>
+
+ handled = false
+ if jqxhr.status == 422
+ body = JSON.parse(jqxhr.responseText)
+ if body.errors?.cart_id?[0] == 'has already been taken'
+ console.log("already taken, just show shopping cart")
+ window.open('/client#/shoppingCart')
+ return
+ else if body.errors && body.errors.base
+ handled = true
+ alert("You can not have a mix of free and non-free items in your shopping cart.\n\nIf you want to add this new item to your shopping cart, then clear out all current items by clicking on the shopping cart icon and clicking 'delete' next to each item.")
+ if !handled
+ alert("Error adding to shoppig cart. " + jqxhr.responseText)
+ ))
+
downloadStem: (e) ->
if @verificationCheck()
e.preventDefault()
@@ -601,6 +632,12 @@ mixins.push(Reflux.listenTo(UserStore, 'onUserChanged'))
selectedTrackId = $select.val()
+ if !@state.jamTrackState.jamTrack.can_download
+ e.preventDefault()
+ if confirm("You have not purchased the rights to download a JamTrack. Add them to your shopping cart?")
+ @addUpgradeToCart(@state.jamTrackState.jamTrack)
+ return
+
if !selectedTrackId? || selectedTrackId == ''
e.preventDefault()
alert("You must select a track in order to download and also click the folder icon.")
@@ -658,6 +695,13 @@ mixins.push(Reflux.listenTo(UserStore, 'onUserChanged'))
e.preventDefault()
return
+ if !@state.jamTrackState.jamTrack.can_download
+ e.preventDefault()
+ if confirm("You have not purchased the rights to download a JamTrack. Add them to your shopping cart?")
+ @addUpgradeToCart(@state.jamTrackState.jamTrack)
+
+ return
+
if /iPhone|iPad|iPod/i.test(navigator.userAgent)
# fall through
diff --git a/web/app/assets/javascripts/react-components/PopupMediaControls.js.jsx.coffee b/web/app/assets/javascripts/react-components/PopupMediaControls.js.jsx.coffee
index 63da519aa..4f845d8df 100644
--- a/web/app/assets/javascripts/react-components/PopupMediaControls.js.jsx.coffee
+++ b/web/app/assets/javascripts/react-components/PopupMediaControls.js.jsx.coffee
@@ -1,7 +1,7 @@
context = window
logger = context.JK.logger
ReactCSSTransitionGroup = React.addons.CSSTransitionGroup;
-
+rest = context.JK.Rest()
mixins = []
@@ -523,12 +523,49 @@ mixins.push(Reflux.listenTo(UserStore, 'onUserChanged'))
return if @verificationCheck()
+ if !@state.jamTrackState.jamTrack.can_download
+ e.preventDefault()
+ if confirm("You have not purchased the rights to download a JamTrack. Add them to your shopping cart?")
+ @addUpgradeToCart(@state.jamTrackState.jamTrack)
+ return
+
new window.Fingerprint2().get((result, components) => (
redirectTo = "/api/jamtracks/#{jamTrack.id}/stems/master/download.mp3?file_type=mp3&download=1&mark=#{result}"
redirectTo = encodeURIComponent(redirectTo)
AppActions.openExternalUrl(window.location.protocol + '//' + window.location.host + "/signin?redirect-to=#{redirectTo}")
))
+ addUpgradeToCart: (jamtrack) ->
+ console.log("adding upgrade to cart")
+
+ params = {id: jamtrack.id, variant: 'download'}
+
+ rest.addJamtrackToShoppingCart(params).done((response) =>
+ console.log("added item to shopping cart. fast_redeem? " + response.fast_redeem)
+ if response.fast_reedem
+ if context.JK.currentUserId?
+ AppActions.openExternalUrl(window.location.protocol + '//' + window.location.host + '/client#/redeemComplete')
+ else
+ AppActions.openExternalUrl(window.location.protocol + '//' + window.location.host + '/client#/redeemSignup')
+ else
+ AppActions.openExternalUrl(window.location.protocol + '//' + window.location.host + '/client#/shoppingCart')
+
+ ).fail(((jqxhr) =>
+
+ handled = false
+ if jqxhr.status == 422
+ body = JSON.parse(jqxhr.responseText)
+ if body.errors?.cart_id?[0] == 'has already been taken'
+ console.log("already taken, just show shopping cart")
+ AppActions.openExternalUrl(window.location.protocol + '//' + window.location.host + '/client#/shoppingCart')
+ return
+ else if body.errors && body.errors.base
+ handled = true
+ alert("You can not have a mix of free and non-free items in your shopping cart.\n\nIf you want to add this new item to your shopping cart, then clear out all current items by clicking on the shopping cart icon and clicking 'delete' next to each item.")
+ if !handled
+ alert("Error adding to shoppig cart. " + jqxhr.responseText)
+ ))
+
stemChanged:() ->
stemDownload: (e) ->
e.preventDefault()
@@ -537,6 +574,12 @@ mixins.push(Reflux.listenTo(UserStore, 'onUserChanged'))
$select = $(this.getDOMNode()).find('.active-stem-select')
+ if !@state.jamTrackState.jamTrack.can_download
+ e.preventDefault()
+ if confirm("You have not purchased the rights to download a JamTrack. Add them to your shopping cart?")
+ @addUpgradeToCart(@state.jamTrackState.jamTrack)
+ return
+
selectedTrackId = $select.val()
if !selectedTrackId? || selectedTrackId == ''
diff --git a/web/app/assets/javascripts/react-components/landing/JamClassAffiliateLandingBottomPage.js.jsx.coffee b/web/app/assets/javascripts/react-components/landing/JamClassAffiliateLandingBottomPage.js.jsx.coffee
index 204353571..5ae864747 100644
--- a/web/app/assets/javascripts/react-components/landing/JamClassAffiliateLandingBottomPage.js.jsx.coffee
+++ b/web/app/assets/javascripts/react-components/landing/JamClassAffiliateLandingBottomPage.js.jsx.coffee
@@ -98,7 +98,7 @@ rest = context.JK.Rest()
And moreā¦
- JamTracks sell for $1.99 each. Musicians love to play with these, and typically buy a few at a
+ JamTracks sell for $1.99 each ($4.99 to include ability to download). Musicians love to play with these, and typically buy a few at a
time. Imagine that you are selling a set of guitar strings to an electric guitar player. As a
diff --git a/web/app/assets/javascripts/react-components/landing/JamTrackCta.js.jsx.coffee b/web/app/assets/javascripts/react-components/landing/JamTrackCta.js.jsx.coffee
index 490751fd5..1d2cdea72 100644
--- a/web/app/assets/javascripts/react-components/landing/JamTrackCta.js.jsx.coffee
+++ b/web/app/assets/javascripts/react-components/landing/JamTrackCta.js.jsx.coffee
@@ -72,7 +72,7 @@ rest = context.JK.Rest()
{img}
- $1.99 value
+ #{this.props.jam_track.download_price} value
diff --git a/web/app/assets/javascripts/react-components/landing/JamTrackLandingPage.js.jsx.coffee b/web/app/assets/javascripts/react-components/landing/JamTrackLandingPage.js.jsx.coffee
index b3a19c414..0ccbe995e 100644
--- a/web/app/assets/javascripts/react-components/landing/JamTrackLandingPage.js.jsx.coffee
+++ b/web/app/assets/javascripts/react-components/landing/JamTrackLandingPage.js.jsx.coffee
@@ -35,10 +35,10 @@ rest = context.JK.Rest()
if loggedIn
loggedInCtaButton = ``
if !@isFree()
- loggedInPriceAdvisory = `
${this.props.jam_track.price}
`
+ loggedInPriceAdvisory = `
${this.props.jam_track.download_price}
`
else
if !@isFree()
- loggedOutPriceAdvisory = `
${this.props.jam_track.price}
`
+ loggedOutPriceAdvisory = `
${this.props.jam_track.download_price}
`
if this.state.loginErrors?
for key, value of this.state.loginErrors
diff --git a/web/app/assets/javascripts/react-components/landing/ProductJamBlasterBottomPage.js.jsx.coffee b/web/app/assets/javascripts/react-components/landing/ProductJamBlasterBottomPage.js.jsx.coffee
index 44fae616f..a56e46588 100644
--- a/web/app/assets/javascripts/react-components/landing/ProductJamBlasterBottomPage.js.jsx.coffee
+++ b/web/app/assets/javascripts/react-components/landing/ProductJamBlasterBottomPage.js.jsx.coffee
@@ -108,7 +108,7 @@ context = window
-
Your first JamTrack is free, and after that JamTracks are just $1.99 each.
+
Your first JamTrack is free, and after that JamTracks are just $1.99/$4.99 each.
diff --git a/web/app/assets/stylesheets/client/jamtrackSearch.scss b/web/app/assets/stylesheets/client/jamtrackSearch.scss
index cd23a55ab..45e9230ab 100644
--- a/web/app/assets/stylesheets/client/jamtrackSearch.scss
+++ b/web/app/assets/stylesheets/client/jamtrackSearch.scss
@@ -266,9 +266,19 @@
margin-top: 5px;
}
+ .jamtrack-variant-help {
+ margin-bottom:20px;
+ }
+ .jamtrack-add-zone {
+ margin: 8px 0px;
+ position:relative;
+ }
.jamtrack-price {
- margin-top: 5px;
+ width:100%;
+ margin: 0 auto 10px;
font-size: 20px;
+ color:white;
+ display:block;
&.free {
margin-top:0;
@@ -282,7 +292,7 @@
}
.jamtrack-add-cart, .jamtrack-add-cart-disabled {
- margin: 8px 0px;
+ position:relative;
}
.jamtrack-license {
diff --git a/web/app/controllers/api_jam_tracks_controller.rb b/web/app/controllers/api_jam_tracks_controller.rb
index f16c5f00c..32aa02b33 100644
--- a/web/app/controllers/api_jam_tracks_controller.rb
+++ b/web/app/controllers/api_jam_tracks_controller.rb
@@ -164,6 +164,11 @@ class ApiJamTracksController < ApiController
end
if params[:download]
+ if !@jam_track_right.can_download
+ render :json => { :message => "Download rights not purchased"}, :status => 403
+ return
+ end
+
if DownloadTracker.check(current_user, request.remote_ip, jam_track_track, !@jam_track_right.redeemed, params[:mark], false)
render :json => { :message => "IP blacklisted"}, :status => 403
return
@@ -323,20 +328,12 @@ class ApiJamTracksController < ApiController
def ios_order_placed
jam_track = JamTrack.find(params[:jam_track_id])
- jam_track_right = jam_track.right_for_user(current_user)
-
- # the user already owns this JamTrac, so just short-circuit out
- if jam_track_right
- response = {name: jam_track.name, id: jam_track.id, jam_track_right_id: jam_track_right.id, version: jam_track.version}
- render :json => response, :status => 200
- return
- end
-
begin
Sale.ios_purchase(current_user,
jam_track,
params[:receipt],
- params[:price_data])
+ params[:price_data],
+ params[:variant])
rescue
response = { message: $!.to_s }
render :json => response, :status => 422
diff --git a/web/app/controllers/api_shopping_carts_controller.rb b/web/app/controllers/api_shopping_carts_controller.rb
index e45429f86..42fc100fd 100644
--- a/web/app/controllers/api_shopping_carts_controller.rb
+++ b/web/app/controllers/api_shopping_carts_controller.rb
@@ -20,7 +20,7 @@ class ApiShoppingCartsController < ApiController
raise StateError, "Invalid JamTrack."
end
- @cart = ShoppingCart.add_jam_track_to_cart(any_user, jam_track, clear:params[:clear])
+ @cart = ShoppingCart.add_jam_track_to_cart(any_user, jam_track, params[:variant])
if @cart.errors.any?
response.status = :unprocessable_entity
diff --git a/web/app/views/api_jam_tracks/show.rabl b/web/app/views/api_jam_tracks/show.rabl
index d62bcebf2..839e26e64 100644
--- a/web/app/views/api_jam_tracks/show.rabl
+++ b/web/app/views/api_jam_tracks/show.rabl
@@ -1,6 +1,6 @@
object @jam_track
-attributes :id, :name, :description, :recording_type, :original_artist, :songwriter, :publisher, :sales_region, :price, :version, :duration, :year, :plan_code, :allow_free
+attributes :id, :name, :description, :recording_type, :original_artist, :songwriter, :publisher, :sales_region, :price, :version, :duration, :year, :plan_code, :allow_free, :download_price, :upgrade_price
node :genres do |item|
item.genres.select(:description).map(&:description)
@@ -10,6 +10,10 @@ node :added_cart do |item|
any_user.shopping_carts.where(cart_id: item.id).count != 0
end
+node :can_download do |item|
+ !!item.right_for_user(current_user, ShoppingCart::JAMTRACK_FULL)
+end
+
node :purchased do |item|
!!item.right_for_user(current_user)
end
diff --git a/web/app/views/api_jam_tracks/show_for_client.rabl b/web/app/views/api_jam_tracks/show_for_client.rabl
index 7705fc91a..9a528e03e 100644
--- a/web/app/views/api_jam_tracks/show_for_client.rabl
+++ b/web/app/views/api_jam_tracks/show_for_client.rabl
@@ -10,6 +10,10 @@ node :jmep do |jam_track|
jam_track.jmep_json ? jam_track.jmep_json : nil
end
+node :can_download do |item|
+ !!item.right_for_user(current_user, ShoppingCart::JAMTRACK_FULL)
+end
+
child(:jam_track_tracks => :tracks) {
attributes :id, :part, :instrument, :track_type, :position
diff --git a/web/app/views/api_jam_tracks/show_for_mobile.rabl b/web/app/views/api_jam_tracks/show_for_mobile.rabl
index 79b5183c7..dc68d2539 100644
--- a/web/app/views/api_jam_tracks/show_for_mobile.rabl
+++ b/web/app/views/api_jam_tracks/show_for_mobile.rabl
@@ -1,7 +1,11 @@
object @jam_track
-attributes :id, :name, :original_artist, :year, :genre_name
+attributes :id, :name, :original_artist, :year, :genre_name, :can_download
node :purchased_at do |jt|
Time.parse(jt.purchased_at).to_i rescue Time.now.to_i
end
+
+node :can_download do |item|
+ !!item.right_for_user(current_user, ShoppingCart::JAMTRACK_FULL)
+end
\ No newline at end of file
diff --git a/web/app/views/api_jam_tracks/show_jam_track_right.rabl b/web/app/views/api_jam_tracks/show_jam_track_right.rabl
index 365730236..2395670a5 100644
--- a/web/app/views/api_jam_tracks/show_jam_track_right.rabl
+++ b/web/app/views/api_jam_tracks/show_jam_track_right.rabl
@@ -1,3 +1,3 @@
object @jam_track_right
-attributes :id, :error_count, :error_reason, :error_detail, :signing_state, :packaging_steps, :current_packaging_step
\ No newline at end of file
+attributes :id, :error_count, :error_reason, :error_detail, :signing_state, :packaging_steps, :current_packaging_step, :can_download
\ No newline at end of file
diff --git a/web/app/views/clients/_help.html.slim b/web/app/views/clients/_help.html.slim
index 344fbaaf8..c80c8f165 100644
--- a/web/app/views/clients/_help.html.slim
+++ b/web/app/views/clients/_help.html.slim
@@ -400,6 +400,15 @@ script type="text/template" id="template-help-teacher-profile"
a href="https://jamkazam.desk.com/customer/en/portal/articles/2405835-creating-your-teacher-profile#EditTeacherProfile" rel="external" Click here
| for a help article that explains how to fill out your teacher profile effectively to attract students.
+script type="text/template" id="template-help-jamtrack-variants"
+ .jamtrack-variants.big-dark-help
+ p
+ | The FULL package of a JamTrack will let you also download each track or mix to a personal device. You can always upgrade to FULL later.
+
+script type="text/template" id="template-help-jamtrack-upgrade"
+ .jamtrack-upgrade.big-dark-help
+ p
+ | Upgrade your JamTrack so that you can download each track or mix to a personal device.
script type="text/template" id="template-help-side-remaining-jamclass-credits"
.side-remaining-jamclass-credits
diff --git a/web/app/views/layouts/web.html.erb b/web/app/views/layouts/web.html.erb
index 53082fb91..e26147b4c 100644
--- a/web/app/views/layouts/web.html.erb
+++ b/web/app/views/layouts/web.html.erb
@@ -56,7 +56,7 @@
<% if @show_cta_free_jamtrack %>
<%= link_to image_tag("web/free-jamtrack-cta.png", :alt => "ClICK HERE TO PICK YOUR FIRST JAMTRACK FREE!"), "/client#/jamtrack/search", class: "cta-free-jamtrack" %>
- $1.99 value
+ $4.99 value
<% end %>
diff --git a/web/app/views/users/_downloads.html.slim b/web/app/views/users/_downloads.html.slim
index 3bb00d2ef..1b03f0c11 100644
--- a/web/app/views/users/_downloads.html.slim
+++ b/web/app/views/users/_downloads.html.slim
@@ -29,7 +29,7 @@
.badge-number 3
| Get your free JamTrack
span.special-value
- | ($1.99 value)
+ | ($4.99 value)
.jamtrack-content
diff --git a/web/config/routes.rb b/web/config/routes.rb
index 1de024e15..003d4982e 100644
--- a/web/config/routes.rb
+++ b/web/config/routes.rb
@@ -23,7 +23,7 @@ Rails.application.routes.draw do
match '/redeem_giftcard', to: 'landings#redeem_giftcard', via: :get
- # landing pages
+ # landing pageslanding
get '/jamtracks', to: 'landings#simple_jamtracks', as: 'landing_simple_jamtracks'
get '/jamclass', to: 'landings#simple_jamclass', as: 'landing_simple_class'
get '/landing/wb', to: 'landings#watch_bands', as: 'landing_wb'
diff --git a/web/spec/controllers/api_jamblasters_controller_spec.rb b/web/spec/controllers/api_jamblasters_controller_spec.rb
index 80381afa0..c8aeac195 100644
--- a/web/spec/controllers/api_jamblasters_controller_spec.rb
+++ b/web/spec/controllers/api_jamblasters_controller_spec.rb
@@ -5,6 +5,8 @@ describe ApiJamblastersController, type: :controller do
let(:user) { FactoryGirl.create(:user) }
let(:jamblaster) { FactoryGirl.create(:jamblaster, user: user) }
+ let(:user2) { FactoryGirl.create(:user) }
+
before(:each) do
JamblasterUser.delete_all
JamblasterPairingRequest.delete_all
@@ -301,6 +303,77 @@ describe ApiJamblastersController, type: :controller do
jamblaster.reload
jamblaster.users.include?(user).should be true
end
+
+ it "across two users" do
+ post :start_pairing, {:format => 'json', jbid: jamblaster.client_id, vtoken: 'vtoken4'}
+ response.status.should == 200
+
+ request = JamblasterPairingRequest.where(jamblaster_client_id: jamblaster.client_id, vtoken: 'vtoken4', user_id: user.id).first
+ request.should_not be_nil
+ request.user.should eql(user)
+ request.vtoken.should eq 'vtoken4'
+ request.jamblaster_client_id.should eq jamblaster.client_id
+
+ post :login, {:format => 'json', jbid: jamblaster.client_id, serial_no: jamblaster.serial_no, user_id: user.id, vtoken: 'vtoken4'}
+ json = JSON.parse(response.body)
+ response.status.should == 200
+
+ jamblaster.reload
+ jamblaster.users.include?(user).should be false
+
+ post :pair, {:format => 'json', vtoken: 'vtoken4', user_id: user.id, jbid: jamblaster.client_id, key: 'abc'}
+ response.status.should == 200
+ json = JSON.parse(response.body)
+ json["id"].should eq jamblaster.id
+
+ get :get_tokens, {:format => 'json'}
+ response.status.should == 200
+ json = JSON.parse(response.body)
+ json.length.should eq(1)
+ key = json[0]["pairing"]["key"]
+ key.should eq("abc")
+
+ jamblaster.reload
+ jamblaster.users.include?(user).should be true
+
+
+ # now try with second user!
+ controller.current_user = user2
+
+
+ post :start_pairing, {:format => 'json', jbid: jamblaster.client_id, vtoken: 'vtoken5'}
+ response.status.should == 200
+
+ puts "JSON.parse(response.body) #{JSON.parse(response.body)}"
+ request = JamblasterPairingRequest.where(jamblaster_client_id: jamblaster.client_id, vtoken: 'vtoken5', user_id: user2.id).first
+ request.should_not be_nil
+ request.user.should eql(user2)
+ request.vtoken.should eq 'vtoken5'
+ request.jamblaster_client_id.should eq jamblaster.client_id
+
+ post :login, {:format => 'json', jbid: jamblaster.client_id, serial_no: jamblaster.serial_no, user_id: user2.id, vtoken: 'vtoken5'}
+ json = JSON.parse(response.body)
+ response.status.should == 200
+
+ jamblaster.reload
+ jamblaster.users.include?(user2).should be false
+
+ post :pair, {:format => 'json', vtoken: 'vtoken5', user_id: user2.id, jbid: jamblaster.client_id, key: 'abcd'}
+ response.status.should == 200
+ json = JSON.parse(response.body)
+ json["id"].should eq jamblaster.id
+
+ get :get_tokens, {:format => 'json'}
+ response.status.should == 200
+ json = JSON.parse(response.body)
+ json.length.should eq(1)
+ key = json[0]["pairing"]["key"]
+ key.should eq("abcd")
+
+ jamblaster.reload
+ jamblaster.users.include?(user).should be true
+ jamblaster.users.include?(user2).should be true
+ end
end
end
diff --git a/web/spec/factories.rb b/web/spec/factories.rb
index 892cb7df5..04a7753cc 100644
--- a/web/spec/factories.rb
+++ b/web/spec/factories.rb
@@ -768,8 +768,9 @@ FactoryGirl.define do
sequence(:original_artist) { |n| "original-artist-#{n}" }
sequence(:songwriter) { |n| "songwriter-#{n}" }
sequence(:publisher) { |n| "publisher-#{n}" }
- sales_region 'United States'
+ sales_region 'Worldwide'
price 1.99
+ download_price 4.99
reproduction_royalty true
public_performance_royalty true
reproduction_royalty_amount 0.999
diff --git a/web/spec/features/checkout_spec.rb b/web/spec/features/checkout_spec.rb
index ce5ca1c5d..4a2e1f86a 100644
--- a/web/spec/features/checkout_spec.rb
+++ b/web/spec/features/checkout_spec.rb
@@ -38,9 +38,9 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
JamTrack.delete_all
- @jamtrack_acdc_backinblack = FactoryGirl.create(:jam_track, name: 'Back in Black', original_artist: 'AC/DC', sales_region: 'United States', make_track: true, plan_code: 'jamtrack-acdc-backinblack')
- @jamtrack_pearljam_evenflow = FactoryGirl.create(:jam_track, name: 'Even Flow', original_artist: 'Pearl Jam', sales_region: 'United States', make_track: true, plan_code: 'jamtrack-pearljam-evenflow')
- @jamtrack_led_zeppelin_kashmir = FactoryGirl.create(:jam_track, name: 'Kashmir', original_artist: 'Led Zeppelin', sales_region: 'United States', make_track: true, plan_code: 'jamtrack-led-zeppelin-kashmir')
+ @jamtrack_acdc_backinblack = FactoryGirl.create(:jam_track, name: 'Back in Black', original_artist: 'AC/DC', sales_region: 'Worldwide', make_track: true, plan_code: 'jamtrack-acdc-backinblack')
+ @jamtrack_pearljam_evenflow = FactoryGirl.create(:jam_track, name: 'Even Flow', original_artist: 'Pearl Jam', sales_region: 'Worldwide', make_track: true, plan_code: 'jamtrack-pearljam-evenflow')
+ @jamtrack_led_zeppelin_kashmir = FactoryGirl.create(:jam_track, name: 'Kashmir', original_artist: 'Led Zeppelin', sales_region: 'Worldwide', make_track: true, plan_code: 'jamtrack-led-zeppelin-kashmir')
# make sure plans are there
@recurlyClient.create_jam_track_plan(@jamtrack_acdc_backinblack) unless @recurlyClient.find_jam_track_plan(@jamtrack_acdc_backinblack)
@@ -525,11 +525,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
fast_signin(user, '/client#/checkoutOrder')
find('p.order-prompt')
- find('.order-items-value.order-total', text:'$1.99')
+ find('.order-items-value.order-total', text:'$4.99')
find('.order-items-value.shipping-handling', text:'$0.00')
- find('.order-items-value.sub-total', text:'$1.99')
+ find('.order-items-value.sub-total', text:'$4.99')
find('.order-items-value.taxes', text:'$0.00')
- find('.order-items-value.grand-total', text:'$1.99')
+ find('.order-items-value.grand-total', text:'$4.99')
end
it "shows one free, one not free item correctly (Texas)" do
@@ -550,11 +550,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
fast_signin(user, '/client#/checkoutOrder')
find('p.order-prompt')
- find('.order-items-value.order-total', text:'$1.99')
+ find('.order-items-value.order-total', text:'$4.99')
find('.order-items-value.shipping-handling', text:'$0.00')
- find('.order-items-value.sub-total', text:'$1.99')
- find('.order-items-value.taxes', text:'$0.16')
- find('.order-items-value.grand-total', text:'$2.15')
+ find('.order-items-value.sub-total', text:'$4.99')
+ find('.order-items-value.taxes', text:'$0.41')
+ find('.order-items-value.grand-total', text:'$5.40')
end
it "shows one non-free item correctly (not Texas)" do
@@ -573,11 +573,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
fast_signin(user, '/client#/checkoutOrder')
find('p.order-prompt')
- find('.order-items-value.order-total', text:'$1.99')
+ find('.order-items-value.order-total', text:'$4.99')
find('.order-items-value.shipping-handling', text:'$0.00')
- find('.order-items-value.sub-total', text:'$1.99')
+ find('.order-items-value.sub-total', text:'$4.99')
find('.order-items-value.taxes', text:'$0.00')
- find('.order-items-value.grand-total', text:'$1.99')
+ find('.order-items-value.grand-total', text:'$4.99')
end
it "shows one non-free item correctly (Texas)" do
@@ -595,11 +595,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
fast_signin(user, '/client#/checkoutOrder')
find('p.order-prompt')
- find('.order-items-value.order-total', text:'$1.99')
+ find('.order-items-value.order-total', text:'$4.99')
find('.order-items-value.shipping-handling', text:'$0.00')
- find('.order-items-value.sub-total', text:'$1.99')
- find('.order-items-value.taxes', text:'$0.16')
- find('.order-items-value.grand-total', text:'$2.15')
+ find('.order-items-value.sub-total', text:'$4.99')
+ find('.order-items-value.taxes', text:'$0.41')
+ find('.order-items-value.grand-total', text:'$5.40')
end
it "shows two non-free items correctly (non-Texas)" do
@@ -620,11 +620,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
fast_signin(user, '/client#/checkoutOrder')
find('p.order-prompt')
- find('.order-items-value.order-total', text:'$3.98')
+ find('.order-items-value.order-total', text:'$9.98')
find('.order-items-value.shipping-handling', text:'$0.00')
- find('.order-items-value.sub-total', text:'$3.98')
+ find('.order-items-value.sub-total', text:'$9.98')
find('.order-items-value.taxes', text:'$0.00')
- find('.order-items-value.grand-total', text:'$3.98')
+ find('.order-items-value.grand-total', text:'$9.98')
end
it "shows two non-free items correctly (Texas)" do
@@ -644,11 +644,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
fast_signin(user, '/client#/checkoutOrder')
find('p.order-prompt')
- find('.order-items-value.order-total', text:'$3.98')
+ find('.order-items-value.order-total', text:'$9.98')
find('.order-items-value.shipping-handling', text:'$0.00')
- find('.order-items-value.sub-total', text:'$3.98')
- find('.order-items-value.taxes', text:'$0.33')
- find('.order-items-value.grand-total', text:'$4.31')
+ find('.order-items-value.sub-total', text:'$9.98')
+ find('.order-items-value.taxes', text:'$0.82')
+ find('.order-items-value.grand-total', text:'$10.80')
find('.place-order-center a.button-orange.place-order').trigger(:click)
@@ -675,7 +675,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
acdc_sale.product_id.should eq(jamtrack_acdc_backinblack.id)
acdc_sale.quantity.should eq(1)
acdc_sale.free.should eq(0)
- acdc_sale.unit_price.should eq(1.99)
+ acdc_sale.unit_price.should eq(4.99)
acdc_sale.sale.should eq(sale)
pearljam_sale = SaleLineItem.find_by_recurly_adjustment_uuid(pearljam.recurly_adjustment_uuid)
pearljam_sale.recurly_plan_code.should eq(jamtrack_pearljam_evenflow.plan_code)
@@ -683,7 +683,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
pearljam_sale.product_id.should eq(jamtrack_pearljam_evenflow.id)
pearljam_sale.quantity.should eq(1)
pearljam_sale.free.should eq(0)
- pearljam_sale.unit_price.should eq(1.99)
+ pearljam_sale.unit_price.should eq(4.99)
pearljam_sale.sale.should eq(sale)
end
@@ -760,7 +760,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
acdc_sale.product_id.should eq(jamtrack_acdc_backinblack.id)
acdc_sale.quantity.should eq(1)
acdc_sale.free.should eq(1)
- acdc_sale.unit_price.should eq(1.99)
+ acdc_sale.unit_price.should eq(4.99)
acdc_sale.sale.should eq(sale)
@@ -772,11 +772,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
visit "/client?song=#{jamtrack_pearljam_evenflow.name}#/jamtrack/search"
- find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_pearljam_evenflow.id}\"]", text: 'ADD TO CART').trigger(:click)
+ find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_pearljam_evenflow.id}\"]", text: 'ADD TO CART (FULL)').trigger(:click)
find('h1', text: 'shopping cart')
find('.cart-item-caption', text: "JamTrack: #{jamtrack_pearljam_evenflow.name}")
- find('.cart-item-price', text: "$ #{jamtrack_pearljam_evenflow.price}")
- find('.shopping-sub-total', text:"Subtotal:$ #{jamtrack_pearljam_evenflow.price}")
+ find('.cart-item-price', text: "$ #{jamtrack_pearljam_evenflow.download_price}")
+ find('.shopping-sub-total', text:"Subtotal:$ #{jamtrack_pearljam_evenflow.download_price}")
# attempt to checkout
find('a.button-orange', text: 'PROCEED TO CHECKOUT').trigger(:click)
@@ -803,11 +803,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
# 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.order-total', text:'$4.99')
find('.order-items-value.shipping-handling', text:'$0.00')
- find('.order-items-value.sub-total', text:'$1.99')
- find('.order-items-value.taxes', text:'$0.16')
- find('.order-items-value.grand-total', text:'$2.15')
+ find('.order-items-value.sub-total', text:'$4.99')
+ find('.order-items-value.taxes', text:'$0.41')
+ find('.order-items-value.grand-total', text:'$5.40')
# click the ORDER button
find('.place-order-center a.button-orange.place-order').trigger(:click)
@@ -823,6 +823,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
# make sure it appears the user actually bought the jamtrack!
jam_track_right.should_not be_nil
jam_track_right.redeemed.should be false
+ jam_track_right.can_download.should be true
guy.has_redeemable_jamtrack.should be false
# verify sales data
@@ -835,7 +836,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
acdc_sale.product_id.should eq(jamtrack_pearljam_evenflow.id)
acdc_sale.quantity.should eq(1)
acdc_sale.free.should eq(0)
- acdc_sale.unit_price.should eq(1.99)
+ acdc_sale.unit_price.should eq(4.99)
acdc_sale.sale.should eq(sale)
end
@@ -877,11 +878,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
visit "/client?song=#{jamtrack_pearljam_evenflow.name}#/jamtrack/search"
- find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_pearljam_evenflow.id}\"]", text: 'ADD TO CART').trigger(:click)
+ find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_pearljam_evenflow.id}\"]", text: 'ADD TO CART (FULL)').trigger(:click)
find('h1', text: 'shopping cart')
find('.cart-item-caption', text: "JamTrack: #{jamtrack_pearljam_evenflow.name}")
- find('.cart-item-price', text: "$ #{jamtrack_pearljam_evenflow.price}")
- find('.shopping-sub-total', text:"Subtotal:$ #{jamtrack_pearljam_evenflow.price}")
+ find('.cart-item-price', text: "$ #{jamtrack_pearljam_evenflow.download_price}")
+ find('.shopping-sub-total', text:"Subtotal:$ #{jamtrack_pearljam_evenflow.download_price}")
# attempt to checkout
find('a.button-orange', text: 'PROCEED TO CHECKOUT').trigger(:click)
@@ -908,11 +909,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
# 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.order-total', text:'$4.99')
find('.order-items-value.shipping-handling', text:'$0.00')
- find('.order-items-value.sub-total', text:'$1.99')
- find('.order-items-value.taxes', text:'$0.16')
- find('.order-items-value.grand-total', text:'$2.15')
+ find('.order-items-value.sub-total', text:'$4.99')
+ find('.order-items-value.taxes', text:'$0.41')
+ find('.order-items-value.grand-total', text:'$5.40')
# click the ORDER button
find('.place-order-center a.button-orange.place-order').trigger(:click)
@@ -928,6 +929,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
# make sure it appears the user actually bought the jamtrack!
jam_track_right.should_not be_nil
jam_track_right.redeemed.should be false
+ jam_track_right.can_download.should be true
guy.has_redeemable_jamtrack.should be false
# verify sales data
@@ -938,7 +940,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
acdc_sale.affiliate_referral.should eq(partner)
acdc_sale.affiliate_refunded.should be false
acdc_sale.affiliate_refunded_at.should be_nil
- acdc_sale.affiliate_referral_fee_in_cents.should eq(20)
+ acdc_sale.affiliate_referral_fee_in_cents.should eq(50)
end
@@ -969,7 +971,65 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
find('h1', text: 'jamtracks')
#find('a', text: 'What is a JamTrack?')
- find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_acdc_backinblack.id}\"]", text: 'ADD TO CART').trigger(:click)
+ find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_acdc_backinblack.id}\"]", text: 'ADD TO CART (FULL)').trigger(:click)
+ find('h1', text: 'shopping cart')
+ find('.cart-item-caption', text: "JamTrack: #{jamtrack_acdc_backinblack.name}")
+ find('.cart-item-price', text: "$ #{jamtrack_acdc_backinblack.download_price}") # 1st one is free!
+ find('.shopping-sub-total', text:"Subtotal:$ 4.99")
+
+ # attempt to checkout
+ find('a.button-orange', text: 'PROCEED TO CHECKOUT').trigger(:click)
+
+ # we should be skipping the signin screen, and be taken directly to payment
+
+ # this should take us to the payment screen
+ find('p.payment-prompt')
+
+ # fill out all billing info and account info
+ fill_in 'billing-first-name', with: 'Seth'
+ fill_in 'billing-last-name', with: 'Call'
+ fill_in 'billing-address1', with: '10704 Buckthorn Drive'
+ fill_in 'billing-city', with: 'Austin'
+ fill_in 'billing-state', with: 'Texas'
+ fill_in 'billing-zip', with: '78759'
+ fill_in 'card-number', with: '4111111111111111'
+ fill_in 'card-verify', with: '012'
+
+ # try to submit, and see order page
+ find('#payment-info-next').trigger(:click)
+
+ # now see order page, and everything should appear free
+ find('p.order-prompt')
+ find('.order-items-value.order-total', text:'$4.99')
+ find('.order-items-value.shipping-handling', text:'$0.00')
+ find('.order-items-value.sub-total', text:'$4.99')
+ find('.order-items-value.taxes', text:'$0.41')
+ find('.order-items-value.grand-total', text:'$5.40')
+
+ # click the ORDER button
+ find('.place-order-center a.button-orange.place-order').trigger(:click)
+
+ # and now we should see confirmation, and a notice that we are in a normal browser
+ find('.thanks-detail.jam-tracks-in-browser')
+
+ user.reload
+ jam_track_right = jamtrack_acdc_backinblack.right_for_user(user)
+ # make sure it appears the user actually bought the jamtrack!
+ jam_track_right.should_not be_nil
+ jam_track_right.redeemed.should be false
+ jam_track_right.can_download.should be true
+ user.has_redeemable_jamtrack.should be false
+ end
+
+ it "for existing user buying stream-only with no freebie available (already logged in)" do
+ user.has_redeemable_jamtrack = false
+ user.save!
+
+ fast_signin(user, "/client?song=#{jamtrack_acdc_backinblack.name}#/jamtrack/search")
+ find('h1', text: 'jamtracks')
+ #find('a', text: 'What is a JamTrack?')
+
+ find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_acdc_backinblack.id}\"][data-variant=\"stream\"]", text: 'ADD TO CART').trigger(:click)
find('h1', text: 'shopping cart')
find('.cart-item-caption', text: "JamTrack: #{jamtrack_acdc_backinblack.name}")
find('.cart-item-price', text: "$ #{jamtrack_acdc_backinblack.price}") # 1st one is free!
@@ -1015,9 +1075,48 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
# make sure it appears the user actually bought the jamtrack!
jam_track_right.should_not be_nil
jam_track_right.redeemed.should be false
+ jam_track_right.can_download.should be false
user.has_redeemable_jamtrack.should be false
+
+ user.sales.length.should eq(1)
+ sale = user.sales.last
+ sale.sale_line_items.length.should eq(1)
+ line_item = sale.sale_line_items[0]
+ line_item.unit_price.should eq(1.99)
+
+ # now to upgrade it!
+
+ visit "/client?song=#{jamtrack_acdc_backinblack.name}#/jamtrack/search"
+ find('h1', text: 'jamtracks')
+ #find('a', text: 'What is a JamTrack?')
+
+ upgrade_price = jamtrack_acdc_backinblack.download_price - jamtrack_acdc_backinblack.price
+ upgrade_price.should eql 3
+
+ find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_acdc_backinblack.id}\"][data-variant=\"download\"]", text: 'UPGRADE').trigger(:click)
+ find('h1', text: 'shopping cart')
+ find('.cart-item-caption', text: "JamTrack: #{jamtrack_acdc_backinblack.name}")
+ find('.cart-item-price', text: "$ 3.00")
+ find('.shopping-sub-total', text:"Subtotal:$ 3.00")
+
+ # attempt to checkout
+ find('a.button-orange', text: 'PROCEED TO CHECKOUT').trigger(:click)
+
+ # click the ORDER button
+ find('.place-order-center a.button-orange.place-order').trigger(:click)
+
+ find('.thanks-detail.jam-tracks-in-browser')
+
+ user.reload
+ user.sales.length.should eq(2)
+ sale = user.sales.last
+ sale.sale_line_items.length.should eq(1)
+ line_item = sale.sale_line_items[0]
+ line_item.unit_price.should eq(3.00)
+
end
+
it "for existing user with a freebie (starts shopping anonymously)" do
user.has_redeemable_jamtrack = true
user.save!
@@ -1063,6 +1162,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
# make sure it appears the user actually bought the jamtrack!
jam_track_right.should_not be_nil
jam_track_right.redeemed.should be true
+ jam_track_right.can_download.should be true
user.has_redeemable_jamtrack.should be false
# verify sales data
@@ -1075,7 +1175,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
acdc_sale.product_id.should eq(jamtrack_acdc_backinblack.id)
acdc_sale.quantity.should eq(1)
acdc_sale.free.should eq(1)
- acdc_sale.unit_price.should eq(1.99)
+ acdc_sale.unit_price.should eq(4.99)
acdc_sale.sale.should eq(sale)
end
@@ -1089,11 +1189,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
find('h1', text: 'jamtracks')
#find('a', text: 'What is a JamTrack?')
- find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_acdc_backinblack.id}\"]", text:'ADD TO CART').trigger(:click)
+ find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_acdc_backinblack.id}\"]", text:'ADD TO CART (FULL)').trigger(:click)
find('h1', text: 'shopping cart')
find('.cart-item-caption', text: "JamTrack: #{jamtrack_acdc_backinblack.name}")
- find('.cart-item-price', text: "$ 1.99") # 1st one is free!
- find('.shopping-sub-total', text:"Subtotal:$ 1.99")
+ find('.cart-item-price', text: "$ 4.99") # 1st one is free!
+ find('.shopping-sub-total', text:"Subtotal:$ 4.99")
# attempt to checkout
find('a.button-orange', text: 'PROCEED TO CHECKOUT').trigger(:click)
@@ -1140,7 +1240,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
acdc_sale.product_id.should eq(jamtrack_acdc_backinblack.id)
acdc_sale.quantity.should eq(1)
acdc_sale.free.should eq(1)
- acdc_sale.unit_price.should eq(1.99)
+ acdc_sale.unit_price.should eq(4.99)
acdc_sale.sale.should eq(sale)
end
@@ -1154,11 +1254,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
find('h1', text: 'jamtracks')
#find('a', text: 'What is a JamTrack?')
- find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_acdc_backinblack.id}\"]", text:'ADD TO CART').trigger(:click)
+ find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_acdc_backinblack.id}\"]", text:'ADD TO CART (FULL)').trigger(:click)
find('h1', text: 'shopping cart')
find('.cart-item-caption', text: "JamTrack: #{jamtrack_acdc_backinblack.name}")
- find('.cart-item-price', text: "$ 1.99") # 1st one is free!
- find('.shopping-sub-total', text:"Subtotal:$ 1.99")
+ find('.cart-item-price', text: "$ 4.99") # 1st one is free!
+ find('.shopping-sub-total', text:"Subtotal:$ 4.99")
# attempt to checkout
find('a.button-orange', text: 'PROCEED TO CHECKOUT').trigger(:click)
@@ -1196,11 +1296,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
# now see order page, and everything should appear free
find('p.order-prompt')
- find('.order-items-value.order-total', text:'$1.99')
+ find('.order-items-value.order-total', text:'$4.99')
find('.order-items-value.shipping-handling', text:'$0.00')
- find('.order-items-value.sub-total', text:'$1.99')
- find('.order-items-value.taxes', text:'$0.16')
- find('.order-items-value.grand-total', text:'$2.15')
+ find('.order-items-value.sub-total', text:'$4.99')
+ find('.order-items-value.taxes', text:'$0.41')
+ find('.order-items-value.grand-total', text:'$5.40')
# click the ORDER button
find('.place-order-center a.button-orange.place-order').trigger(:click)
@@ -1233,7 +1333,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
acdc_sale.product_id.should eq(jamtrack_acdc_backinblack.id)
acdc_sale.quantity.should eq(1)
acdc_sale.free.should eq(0)
- acdc_sale.unit_price.should eq(1.99)
+ acdc_sale.unit_price.should eq(4.99)
acdc_sale.sale.should eq(sale)
end
end
@@ -1334,14 +1434,14 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
find('a.continue-shopping').trigger(:click)
find('h1', text: 'search jamtracks')
find('.jamtrack-record[data-jamtrack-id="' + jamtrack_pearljam_evenflow.id + '"]')
- find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_pearljam_evenflow.id}\"]", text: 'ADD TO CART').trigger(:click)
+ find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_pearljam_evenflow.id}\"]", text: 'ADD TO CART (FULL)').trigger(:click)
find('h1', text: 'shopping cart')
find('.cart-item-caption', text: "JamTrack: #{jamtrack_pearljam_evenflow.name}")
find('.cart-item-caption', text: "JamTrack: #{jamtrack_led_zeppelin_kashmir.name}")
find('.cart-price', text: "$ 0.00")
- find('.cart-price', text: "$ #{jamtrack_pearljam_evenflow.price}")
- find('.shopping-sub-total', text:"Subtotal:$ #{jamtrack_pearljam_evenflow.price}")
+ find('.cart-price', text: "$ #{jamtrack_pearljam_evenflow.download_price}")
+ find('.shopping-sub-total', text:"Subtotal:$ #{jamtrack_pearljam_evenflow.download_price}")
# attempt to checkout
find('a.button-orange', text: 'PROCEED TO CHECKOUT').trigger(:click)
@@ -1368,11 +1468,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
# 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.order-total', text:'$4.99')
find('.order-items-value.shipping-handling', text:'$0.00')
- find('.order-items-value.sub-total', text:'$1.99')
- find('.order-items-value.taxes', text:'$0.16')
- find('.order-items-value.grand-total', text:'$2.15')
+ find('.order-items-value.sub-total', text:'$4.99')
+ find('.order-items-value.taxes', text:'$0.41')
+ find('.order-items-value.grand-total', text:'$5.40')
# click the ORDER button
find('.place-order-center a.button-orange.place-order').trigger(:click)
@@ -1399,7 +1499,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
fast_signin(user, "/client?song=#{jamtrack_led_zeppelin_kashmir.name}#/jamtrack/search")
find('h1', text: 'jamtracks')
- find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_led_zeppelin_kashmir.id}\"]", text: 'ADD TO CART').trigger(:click)
+ find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_led_zeppelin_kashmir.id}\"]", text: 'ADD TO CART (FULL)').trigger(:click)
find('h1', text: 'shopping cart')
sleep 2
user.reload
@@ -1408,8 +1508,8 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
find('h1', text: 'shopping cart')
find('.cart-item-caption', text: "JamTrack: #{jamtrack_led_zeppelin_kashmir.name}")
- find('.cart-price', text: "$ #{jamtrack_led_zeppelin_kashmir.price}")
- find('.shopping-sub-total', text:"Subtotal:$ #{jamtrack_led_zeppelin_kashmir.price}")
+ find('.cart-price', text: "$ #{jamtrack_led_zeppelin_kashmir.download_price}")
+ find('.shopping-sub-total', text:"Subtotal:$ #{jamtrack_led_zeppelin_kashmir.download_price}")
go_to_root
@@ -1431,8 +1531,8 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
find('.cart-item-caption', text: "JamTrack: #{jamtrack_acdc_backinblack.name}")
find('.cart-item-caption', text: "JamTrack: #{jamtrack_led_zeppelin_kashmir.name}")
find('.cart-price', text: "$ 0.00")
- find('.cart-price', text: "$ #{jamtrack_led_zeppelin_kashmir.price}")
- find('.shopping-sub-total', text:"Subtotal:$ #{jamtrack_led_zeppelin_kashmir.price}")
+ find('.cart-price', text: "$ #{jamtrack_led_zeppelin_kashmir.download_price}")
+ find('.shopping-sub-total', text:"Subtotal:$ #{jamtrack_led_zeppelin_kashmir.download_price}")
# attempt to checkout
find('a.button-orange', text: 'PROCEED TO CHECKOUT').trigger(:click)
@@ -1459,11 +1559,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
# 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.order-total', text:'$4.99')
find('.order-items-value.shipping-handling', text:'$0.00')
- find('.order-items-value.sub-total', text:'$1.99')
- find('.order-items-value.taxes', text:'$0.16')
- find('.order-items-value.grand-total', text:'$2.15')
+ find('.order-items-value.sub-total', text:'$4.99')
+ find('.order-items-value.taxes', text:'$0.41')
+ find('.order-items-value.grand-total', text:'$5.40')
# click the ORDER button
find('.place-order-center a.button-orange.place-order').trigger(:click)
@@ -1492,7 +1592,7 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
fast_signin(user, "/client?song=#{jamtrack_led_zeppelin_kashmir.name}#/jamtrack/search")
find('h1', text: 'jamtracks')
- find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_led_zeppelin_kashmir.id}\"]", text: 'ADD TO CART').trigger(:click)
+ find("a.jamtrack-add-cart[data-jamtrack-id=\"#{jamtrack_led_zeppelin_kashmir.id}\"]", text: 'ADD TO CART (FULL)').trigger(:click)
find('h1', text: 'shopping cart')
sleep 2
user.reload
@@ -1501,8 +1601,8 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
find('h1', text: 'shopping cart')
find('.cart-item-caption', text: "JamTrack: #{jamtrack_led_zeppelin_kashmir.name}")
- find('.cart-price', text: "$ #{jamtrack_led_zeppelin_kashmir.price}")
- find('.shopping-sub-total', text:"Subtotal:$ #{jamtrack_led_zeppelin_kashmir.price}")
+ find('.cart-price', text: "$ #{jamtrack_led_zeppelin_kashmir.download_price}")
+ find('.shopping-sub-total', text:"Subtotal:$ #{jamtrack_led_zeppelin_kashmir.download_price}")
# attempt to checkout
@@ -1530,11 +1630,11 @@ describe "Checkout", :js => true, :type => :feature, :capybara_feature => true d
# 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.order-total', text:'$4.99')
find('.order-items-value.shipping-handling', text:'$0.00')
- find('.order-items-value.sub-total', text:'$1.99')
- find('.order-items-value.taxes', text:'$0.16')
- find('.order-items-value.grand-total', text:'$2.15')
+ find('.order-items-value.sub-total', text:'$4.99')
+ find('.order-items-value.taxes', text:'$0.41')
+ find('.order-items-value.grand-total', text:'$5.40')
# click the ORDER button
find('.place-order-center a.button-orange.place-order').trigger(:click)
diff --git a/web/spec/features/individual_jamtrack_spec.rb b/web/spec/features/individual_jamtrack_spec.rb
index f00c240b5..c882a3c7a 100644
--- a/web/spec/features/individual_jamtrack_spec.rb
+++ b/web/spec/features/individual_jamtrack_spec.rb
@@ -74,7 +74,7 @@ describe "Individual JamTrack", :js => true, :type => :feature, :capybara_featur
# now go back, and then try to click checkout again
visit "/landing/jamtracks/#{@jamtrack_acdc_backinblack.slug}"
find('button.cta-button', text: 'Add To Cart')
- find('.price-advisory', text:"$1.99")
+ find('.price-advisory', text:"$4.99")
find('button.cta-button').trigger(:click)
find('h1', text: 'shopping cart')
diff --git a/web/spec/features/jam_track_searching_spec.rb b/web/spec/features/jam_track_searching_spec.rb
index e31a61b88..ce2194005 100644
--- a/web/spec/features/jam_track_searching_spec.rb
+++ b/web/spec/features/jam_track_searching_spec.rb
@@ -101,16 +101,16 @@ describe "JamTrack Search", :js => true, :type => :feature, :capybara_feature =>
find('a.jamtrack-add-cart.is_free[data-jamtrack-id="' + jt_us.id + '"]', text: 'GET IT FREE!')
find('.jamtrack-record[data-jamtrack-id="' + jt_ww.id + '"] .jamtrack-price.non-free', text: "$ #{jt_ww.price}")
- find('a.jamtrack-add-cart[data-jamtrack-id="' + jt_ww.id + '"]', text: 'ADD TO CART').trigger(:click)
+ find('a.jamtrack-add-cart[data-jamtrack-id="' + jt_ww.id + '"][data-variant="stream"]', text: 'ADD TO CART').trigger(:click)
find('h1', text: 'shopping cart')
find('.cart-item-price', text: "$ #{jt_ww.price}")
find('a', text: 'CONTINUE SHOPPING').trigger(':click')
- find('a.jamtrack-add-cart.is_free[data-jamtrack-id="' + jt_us.id + '"]', text: 'GET IT FREE!').trigger(:click)
+ find('a.jamtrack-add-cart.is_free[data-jamtrack-id="' + jt_us.id + '"][data-variant="full"]', text: 'GET IT FREE!').trigger(:click)
- find('.cart-item-price', text: "$ #{jt_us.price}")
+ find('.cart-item-price', text: "$ #{jt_us.download_price}")
find('.cart-item-price', text: "$ #{jt_ww.price}")
end