spree_api 2.0.0.rc1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWE5YWU1MDZmMjkwNjViNmI0NWNhYmYxMzRhYzgxNjU2NmJmMzkzYw==
4
+ MjMyYzdjYTNkZDcwMDYwYmU2Y2M5OGQzMzA5ODE1NmNjNGZlNDRhYg==
5
5
  data.tar.gz: !binary |-
6
- ODliMjc0ZjAyMDhhZjkyYTUwMGU5MGM1MDMzYjA3Yjk2OGJjNTE1NQ==
6
+ MDM5ZGY2MWU3NTc1OGY0ZDlhMTg0OTdhNWJlODhjOWY2ZWQ1Zjc3Mg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MzkzYzE5N2M3MDgyODdhNDcyMzdjMmRmMDkyYzZhZTczYjFhMTZmZjE2NDBm
10
- MWQ4NDIzODE3NzBmMDAyZjE4NzQ0NTY4YmU4MzdkNGJkNTAyMWM2YjIzYWEy
11
- NmNhYzU0MmE0NzYyNDk2NGZkMjBiZjQwYTQxMGMxYzEyOGNkYjk=
9
+ YzcyMzBlMGVhZjM2MzIwNTIwZWYwYzRhOWU1OThmZGJhNzQ1NDRmY2M4OWM0
10
+ ODBjMDAyNzc5YjdkOGM5YjM3MGVmMmY0ODBhZWU1NWRlZWJhYTYyMWUxNTUx
11
+ MWUzZjg4NDQ3NDdhYTIyNWY3NWNiYWI1OTkxNjcxMDNmZmI2MjM=
12
12
  data.tar.gz: !binary |-
13
- ZjNhMGJiNzg0ZDIwYzgxMzcxYTkwZDdjMTQwYmU0NDMzYWVhMzNlYzE4NWQx
14
- ZGMwODE3ZTA2NTRjMWM0Yjc1NDIzMjNkMTI0ZDEwYWFlNDg2YjA5MjM3NTE0
15
- ZDU0MDA1M2IyODVkMGQyNmJmY2YyYWIwNjViMWVkMTA4NWYxNmY=
13
+ Mjg0NTI5MzVjMTIxNjJjYzQ4ZGM3ZGIxMDkyNTAwZWVhMjFhNDJmNTY4MWNk
14
+ OWQ5MjhiMmViMzkwOTc4ZDQwYTc4NWE3N2MxMDc3NzIxMjMyOWRiZWY1MzFj
15
+ MDFhNzJlMDgwYzlhMWMyNzJkYmI2YzMzZTAxYWY4OGM2MzYyZmY=
@@ -72,7 +72,7 @@ module Spree
72
72
  quantity = params[:quantity].to_i
73
73
 
74
74
  @order.contents.remove(variant, quantity, @shipment)
75
-
75
+ @shipment.reload if @shipment.persisted?
76
76
  respond_with(@shipment, :default_template => :show)
77
77
  end
78
78
 
@@ -16,6 +16,7 @@ child(@variants => :variants) do
16
16
 
17
17
  child(:stock_items) do
18
18
  attributes :id, :count_on_hand, :stock_location_id, :backorderable
19
+ attribute :available? => :available
19
20
 
20
21
  glue(:stock_location) do
21
22
  attribute :name => :stock_location_name
@@ -91,28 +91,18 @@ describe Spree::Api::ShipmentsController do
91
91
 
92
92
  context 'for completed shipments' do
93
93
  let(:order) { create :completed_order_with_totals }
94
-
95
94
  let!(:resource_scoping) { { :order_id => order.to_param, :id => order.shipments.first.to_param } }
96
95
 
97
- it 'can add a variant to a shipment' do
98
- params = {
99
- variant_id: variant.to_param,
100
- quantity: 2
101
- }
102
- api_put :add, params
96
+ it 'adds a variant to a shipment' do
97
+ api_put :add, { variant_id: variant.to_param, quantity: 2 }
103
98
  response.status.should == 200
104
99
  json_response['inventory_units'].select { |h| h['variant_id'] == variant.id }.size.should == 2
105
100
  end
106
101
 
107
- it 'can remove a variant from a shipment' do
102
+ it 'removes a variant from a shipment' do
108
103
  order.contents.add(variant, 2)
109
104
 
110
- params = {
111
- variant_id: variant.to_param,
112
- quantity: 1
113
- }
114
-
115
- api_put :remove, params
105
+ api_put :remove, { variant_id: variant.to_param, quantity: 1 }
116
106
  response.status.should == 200
117
107
  json_response['inventory_units'].select { |h| h['variant_id'] == variant.id }.size.should == 1
118
108
  end
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.0.0.rc1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Bigg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-13 00:00:00.000000000 Z
11
+ date: 2013-05-19 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.0.0.rc1
19
+ version: 2.0.0
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.0.0.rc1
26
+ version: 2.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rabl
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -238,9 +238,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  required_rubygems_version: !ruby/object:Gem::Requirement
240
240
  requirements:
241
- - - ! '>'
241
+ - - ! '>='
242
242
  - !ruby/object:Gem::Version
243
- version: 1.3.1
243
+ version: '0'
244
244
  requirements: []
245
245
  rubyforge_project:
246
246
  rubygems_version: 2.0.3