spree_api 2.2.6 → 2.2.7

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: deb1a6d97cb271dd9cc4a2d1fd18b06e1a9436ab
4
- data.tar.gz: e9f35894fba49ecb7ab11db26ddb751db7faccbc
3
+ metadata.gz: 552423ad87e0055689731580be5866f71756286f
4
+ data.tar.gz: 2158c845b83c58ce9d2d1109296b2e590d61b506
5
5
  SHA512:
6
- metadata.gz: cf795c05d74934c7df5d03a7075fc231959d80f1127041cfc8ae8d44fcf647844aedc6a2aac364fa37f355990336adcf0d3a7215a2df7919973eef1802d8b42b
7
- data.tar.gz: d159dd97e4c2ac33940f0760ba119a832db3006888e5c86c75a431ab7ad74d6fa3d7ee45a1bd639b7ccac479eca96780ec9688e9cbea6841212e156ca513e9d8
6
+ metadata.gz: f4dc598439b0c5efb7dee15afc5ceaba4ba0cd34459834bf725e892540a8d76689532265f65c57ab2a603636f60802ec94b78c7e125bbb17c0b56eb18129ce49
7
+ data.tar.gz: 979ccee54a8e8906d76cda45c7d4b6424905fbc8ce3df112cddf9b911058ed850d9cdf747e11d72115ec55d35b37ac55dafd0fe4dfcbe17e162dd2d989abb99e
@@ -3,9 +3,9 @@ module Spree
3
3
  class OptionTypesController < Spree::Api::BaseController
4
4
  def index
5
5
  if params[:ids]
6
- @option_types = Spree::OptionType.accessible_by(current_ability, :read).where(:id => params[:ids].split(','))
6
+ @option_types = Spree::OptionType.includes(:option_values).accessible_by(current_ability, :read).where(id: params[:ids].split(','))
7
7
  else
8
- @option_types = Spree::OptionType.accessible_by(current_ability, :read).load.ransack(params[:q]).result
8
+ @option_types = Spree::OptionType.includes(:option_values).accessible_by(current_ability, :read).load.ransack(params[:q]).result
9
9
  end
10
10
  respond_with(@option_types)
11
11
  end
@@ -67,7 +67,7 @@ module Spree
67
67
 
68
68
  def find_order
69
69
  @order = Spree::Order.find_by(number: order_id)
70
- authorize! :read, @order
70
+ authorize! :read, @order, order_token
71
71
  end
72
72
 
73
73
  def find_payment
@@ -65,7 +65,7 @@ module Spree
65
65
  # Products#index does not do the sorting.
66
66
  taxon = Spree::Taxon.find(params[:id])
67
67
  @products = taxon.products.ransack(params[:q]).result
68
- @products = @products.page(params[:page]).per(500 || params[:per_page])
68
+ @products = @products.page(params[:page]).per(params[:per_page] || 500)
69
69
  render "spree/api/products/index"
70
70
  end
71
71
 
@@ -174,7 +174,7 @@ module Spree
174
174
  Order.should_receive(:create!).and_return(order = Spree::Order.new)
175
175
  order.stub(:associate_user!)
176
176
  order.stub_chain(:contents, :add).and_return(line_item = double('LineItem'))
177
- line_item.should_receive(:update_attributes).with("special" => true)
177
+ line_item.should_receive(:update_attributes!).with("special" => true)
178
178
 
179
179
  controller.stub(permitted_line_item_attributes: [:id, :variant_id, :quantity, :special])
180
180
  api_post :create, :order => {
@@ -64,6 +64,11 @@ module Spree
64
64
  api_get :index, :order_id => order.to_param
65
65
  assert_unauthorized!
66
66
  end
67
+
68
+ it "can view the payments for an order given the order token" do
69
+ api_get :index, :order_id => order.to_param, :order_token => order.token
70
+ json_response["payments"].first.should have_attributes(attributes)
71
+ end
67
72
  end
68
73
  end
69
74
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Bigg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-19 00:00:00.000000000 Z
11
+ date: 2014-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.6
19
+ version: 2.2.7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.2.6
26
+ version: 2.2.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rabl
29
29
  requirement: !ruby/object:Gem::Requirement