spree_minicart 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,9 @@
|
|
1
1
|
module Spree
|
2
2
|
OrdersController.class_eval do
|
3
|
-
before_filter :set_current_order, :only => [:populate]
|
4
3
|
|
5
4
|
respond_to :js, :only => [:populate, :update]
|
6
5
|
|
7
6
|
ssl_allowed :populate, :update
|
8
7
|
|
9
|
-
def set_current_order
|
10
|
-
current_order(true)
|
11
|
-
end
|
12
8
|
end
|
13
9
|
end
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<div data-hook="outside_minicart_form">
|
13
13
|
<div id="minicart-details" data-hook="minicart_details" class="clearfix">
|
14
14
|
<p>
|
15
|
-
<span><%= t(:subtotal) %>: <span class="order-total"><%= order_subtotal(current_order
|
15
|
+
<span><%= t(:subtotal) %>: <span class="order-total"><%= order_subtotal(current_order) %></span></span>
|
16
16
|
<%= link_to t(:checkout), checkout_path, :class => 'button checkout primary', :id => 'checkout-link' %>
|
17
17
|
</p>
|
18
18
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
feature "minicart", :js => true do
|
4
|
-
background { @product = FactoryGirl.create(:product, :name => "ror mug", :price => 30) }
|
4
|
+
background { @product = FactoryGirl.create(:product, :name => "ror mug", :price => 30, :on_hand => 2) }
|
5
5
|
|
6
6
|
scenario "customer should be able to add and delete a product in the minicart" do
|
7
7
|
visit spree.products_path
|
@@ -100,4 +100,38 @@ feature "minicart", :js => true do
|
|
100
100
|
visit spree.products_path
|
101
101
|
}.to_not change(Spree::Order, :count)
|
102
102
|
end
|
103
|
+
|
104
|
+
scenario 'with allowbackorders to false minicart should not be able to item multiple time' do
|
105
|
+
reset_spree_preferences do |config|
|
106
|
+
config[:allow_backorders] = false
|
107
|
+
end
|
108
|
+
@product.master.update_column :count_on_hand, 1
|
109
|
+
|
110
|
+
visit spree.products_path
|
111
|
+
click_link("ror mug")
|
112
|
+
|
113
|
+
within("li#link-to-cart") do
|
114
|
+
page.should have_content("Cart: (Empty)")
|
115
|
+
end
|
116
|
+
|
117
|
+
click_button "Add To Cart"
|
118
|
+
click_button "Add To Cart"
|
119
|
+
|
120
|
+
within("#link-to-cart a") do
|
121
|
+
page.should have_content("(2)")
|
122
|
+
end
|
123
|
+
|
124
|
+
within("#minicart") do
|
125
|
+
page.should have_content("ror mug")
|
126
|
+
page.should have_content('Insufficient stock available, only 1 remaining')
|
127
|
+
end
|
128
|
+
|
129
|
+
visit spree.products_path
|
130
|
+
|
131
|
+
within("#link-to-cart a") do
|
132
|
+
page.should have_content("(1)")
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
|
103
137
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_minicart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spree_core
|
@@ -194,6 +194,7 @@ files:
|
|
194
194
|
- script/rails
|
195
195
|
- spec/requests/minicart_spec.rb
|
196
196
|
- spec/spec_helper.rb
|
197
|
+
- spec/support/preferences.rb
|
197
198
|
- spec/support/shared_connection.rb
|
198
199
|
- spree_minicart.gemspec
|
199
200
|
homepage: https://github.com/sbounmy/spree_minicart
|
@@ -224,4 +225,5 @@ summary: Spree Minicart displays a minicart in your spree store
|
|
224
225
|
test_files:
|
225
226
|
- spec/requests/minicart_spec.rb
|
226
227
|
- spec/spec_helper.rb
|
228
|
+
- spec/support/preferences.rb
|
227
229
|
- spec/support/shared_connection.rb
|