spree_quick_cart 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d62a6c8025e5f5ad3e2bf25470ba71f2749cfac
4
- data.tar.gz: b943bcb7dc7563d8fd34a410681a08bdbdf841f0
3
+ metadata.gz: a0d92c848d1d2970bdcaa8e29ecda005943b40f6
4
+ data.tar.gz: ff60eb26c51488f83012b8760a33b451acc166be
5
5
  SHA512:
6
- metadata.gz: bdd695998f2ba3f21254400bf8e45fc3a3e42db307aafb5d095d81f4ce11479376bf36fcf4547246e23990494fe4b268d67e896d0b67222679d5294722f1bbeb
7
- data.tar.gz: 37d9251da191bff7c922351659202fd45c07ca41dfcc076b477e60ba96e567fe56f7115e60b6882c547ce92b1bccb6ddb608fd7869ec75f8da1ba7ddd58b611b
6
+ metadata.gz: f0639ebaf72359ff801402fe82c7cfe27bed7d8a076fc6034dc1198f2cb7becc2a98bbff04e61134b0a0379c9a47949a8db6ebe31c21c42b1ca15abd1e134e47
7
+ data.tar.gz: 85d7a632de4f87fe50f5f9e902b1dd1e49b5db4dbf0a21faaf208df66dec089dc0d061b86fdf9ac6720385da7c3601af2e488702f398891d2da91aae772aed36
@@ -4,7 +4,7 @@ function SpreeQuickCart() {
4
4
 
5
5
  this.initializeQuickCartForm = function() {
6
6
  $(".quick-add-to-cart-form").find("form").submit(function() {
7
- that.current_order_path = $(this).closest(".quick-add-to-cart-form").find('.current-order-path').text();
7
+ that.order_path = $(this).closest(".quick-add-to-cart-form").find('.order-path').text();
8
8
 
9
9
  that.submitButton = $(this).find("button");
10
10
  that.buttonEnabled(false);
@@ -39,7 +39,7 @@ function SpreeQuickCart() {
39
39
 
40
40
  this.replaceCartInformation = function() {
41
41
  Spree.ajax({
42
- url: that.current_order_path,
42
+ url: that.order_path,
43
43
  type: "GET",
44
44
  cache: false,
45
45
  dataType: 'json',
@@ -1,5 +1,3 @@
1
- object @current_order
2
-
3
1
  attributes *order_attributes
4
2
  node(:display_item_total) { |o| o.display_item_total.to_s }
5
3
  node(:total_quantity) { |o| o.line_items.sum(:quantity) }
@@ -7,4 +5,3 @@ node(:display_total) { |o| o.display_total.to_s }
7
5
  node(:display_ship_total) { |o| o.display_ship_total }
8
6
  node(:token) { |o| o.token }
9
7
  node(:checkout_steps) { |o| o.checkout_steps }
10
-
@@ -1,7 +1,7 @@
1
1
  .quick-add-to-cart-form
2
2
  - order = current_order(create_order_if_necessary: true)
3
- %span.current-order-path(style="display:none")
4
- = api_current_order_path
3
+ %span.order-path(style="display:none")
4
+ = api_order_path(order, order_token: order.token)
5
5
  = form_tag api_order_line_items_path(order.number), method: :post do
6
6
  .fields
7
7
  = hidden_field_tag "order_token", order.token
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = 'spree_quick_cart'
5
- s.version = '2.2.2'
5
+ s.version = '2.2.3'
6
6
  s.summary = 'Insert add to cart button in product index page'
7
7
  s.description = 'Adds js quick add to cart button to product catalogue'
8
8
  s.required_ruby_version = '>= 2.0.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_quick_cart
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francisco Trindade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-02 00:00:00.000000000 Z
11
+ date: 2014-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -222,10 +222,8 @@ files:
222
222
  - app/assets/javascripts/spree/frontend/spree_quick_cart.js
223
223
  - app/assets/stylesheets/spree/frontend/quick_cart.scss
224
224
  - app/assets/stylesheets/spree/frontend/spree_quick_cart.css
225
- - app/controllers/spree/api/orders_controller_decorator.rb
226
225
  - app/overrides/quick_cart_add_button.rb
227
- - app/views/spree/api/base/current.rabl
228
- - app/views/spree/api/orders/current.rabl
226
+ - app/views/spree/api/orders/order.v1.rabl
229
227
  - app/views/spree/shared/_quick_cart_add_button.haml
230
228
  - bin/rails
231
229
  - config/locales/en.yml
@@ -234,7 +232,6 @@ files:
234
232
  - lib/spree_quick_cart.rb
235
233
  - lib/spree_quick_cart/engine.rb
236
234
  - lib/spree_quick_cart/factories.rb
237
- - spec/controllers/orders_controller_spec.rb
238
235
  - spec/spec_helper.rb
239
236
  - spree_quick_cart.gemspec
240
237
  homepage:
@@ -262,5 +259,4 @@ signing_key:
262
259
  specification_version: 4
263
260
  summary: Insert add to cart button in product index page
264
261
  test_files:
265
- - spec/controllers/orders_controller_spec.rb
266
262
  - spec/spec_helper.rb
@@ -1,10 +0,0 @@
1
- Spree::Api::OrdersController.class_eval do
2
-
3
- include Spree::Core::ControllerHelpers::Order
4
-
5
- def current
6
- current_order
7
- render :current
8
- end
9
-
10
- end
@@ -1,10 +0,0 @@
1
- object @current_order
2
-
3
- attributes *order_attributes
4
- node(:display_item_total) { |o| o.display_item_total.to_s }
5
- node(:total_quantity) { |o| o.line_items.sum(:quantity) }
6
- node(:display_tax_total) { |o| o.display_tax_total }
7
- node(:display_total) { |o| o.display_total.to_s }
8
- node(:display_ship_total) { |o| o.display_ship_total }
9
- node(:token) { |o| o.token }
10
- node(:checkout_steps) { |o| o.checkout_steps }
@@ -1,36 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Spree::Api::OrdersController do
4
-
5
- let(:user) { mock_model Spree::User, :last_incomplete_spree_order => nil, :has_spree_role? => true, :spree_api_key => 'fake' }
6
- before :each do
7
- controller.stub :spree_current_user => user
8
- controller.stub :check_authorization
9
- end
10
-
11
- describe 'current' do
12
-
13
- before :each do
14
- session.stub(:[]).with(anything).and_return nil
15
- end
16
-
17
- it 'should return 200' do
18
- spree_get :current
19
- response.status.should == 200
20
- end
21
-
22
- it 'should assign be empty if session has no order' do
23
- spree_get :current
24
- assigns(:current_order).should be_nil
25
- end
26
-
27
- it 'should return order in session' do
28
- current_order = double(Spree::Order, id: 666)
29
- controller.should_receive(:current_order).at_least(:once)
30
-
31
- spree_get :current, format: :json
32
- end
33
-
34
- end
35
-
36
- end