spree_api 3.0.0.rc4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab9505bfe7982709e648940a6685e64804a59525
|
4
|
+
data.tar.gz: 33f82a1d56bca7c62d7992b90f7db61f37c1a853
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 078ed12604797d085834aebea70d5934c8af84c54aa61c05a1989c21f25d65520b37c331a4dd313dec0a121785aa9528b42fbab8ec9f55935319c689e68fe1e3
|
7
|
+
data.tar.gz: b1a7ee95d0bc92cbbe1626a3732f074504f1589e1ea1d4bb1eda07b73d5417618ff4195b47ea55157ba248598d2bb7bd4afc63a18ecb7dd207b4d967a99fc7d3
|
@@ -17,8 +17,6 @@ module Spree
|
|
17
17
|
before_action :authenticate_user
|
18
18
|
before_action :load_user_roles
|
19
19
|
|
20
|
-
after_filter :set_jsonp_format
|
21
|
-
|
22
20
|
rescue_from Exception, with: :error_during_processing
|
23
21
|
rescue_from ActiveRecord::RecordNotFound, with: :not_found
|
24
22
|
rescue_from CanCan::AccessDenied, with: :unauthorized
|
@@ -26,13 +24,6 @@ module Spree
|
|
26
24
|
|
27
25
|
helper Spree::Api::ApiHelpers
|
28
26
|
|
29
|
-
def set_jsonp_format
|
30
|
-
if params[:callback] && request.get?
|
31
|
-
self.response_body = "#{params[:callback]}(#{response.body})"
|
32
|
-
headers["Content-Type"] = 'application/javascript'
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
27
|
def map_nested_attributes_keys(klass, attributes)
|
37
28
|
nested_keys = klass.nested_attributes_options.keys
|
38
29
|
attributes.inject({}) do |h, (k,v)|
|
@@ -119,11 +110,6 @@ module Spree
|
|
119
110
|
Spree::Ability.new(current_api_user)
|
120
111
|
end
|
121
112
|
|
122
|
-
def current_currency
|
123
|
-
Spree::Config[:currency]
|
124
|
-
end
|
125
|
-
helper_method :current_currency
|
126
|
-
|
127
113
|
def invalid_resource!(resource)
|
128
114
|
@resource = resource
|
129
115
|
render "spree/api/errors/invalid_resource", :status => 422
|
@@ -156,21 +156,6 @@ module Spree
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
159
|
-
context "jsonp" do
|
160
|
-
it "retrieves a list of products of jsonp" do
|
161
|
-
api_get :index, {:callback => 'callback'}
|
162
|
-
expect(response.body).to match(/^callback\(.*\)$/)
|
163
|
-
expect(response.header['Content-Type']).to include('application/javascript')
|
164
|
-
end
|
165
|
-
|
166
|
-
# Regression test for #4332
|
167
|
-
it "does not escape quotes" do
|
168
|
-
api_get :index, {:callback => 'callback'}
|
169
|
-
expect(response.body).to match(/^callback\({"count":1,"total_count":1/)
|
170
|
-
expect(response.header['Content-Type']).to include('application/javascript')
|
171
|
-
end
|
172
|
-
end
|
173
|
-
|
174
159
|
it "can search for products" do
|
175
160
|
create(:product, :name => "The best product in the world")
|
176
161
|
api_get :index, :q => { :name_cont => "best" }
|
@@ -122,9 +122,6 @@ describe Spree::Api::ShipmentsController, :type => :controller do
|
|
122
122
|
context "can transition a shipment from ready to ship" do
|
123
123
|
before do
|
124
124
|
allow_any_instance_of(Spree::Order).to receive_messages(:paid? => true, :complete? => true)
|
125
|
-
# For the shipment notification email
|
126
|
-
Spree::Config[:mails_from] = "spree@example.com"
|
127
|
-
|
128
125
|
shipment.update!(shipment.order)
|
129
126
|
expect(shipment.state).to eq("ready")
|
130
127
|
allow_any_instance_of(Spree::ShippingRate).to receive_messages(:cost => 5)
|
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: 3.0.0
|
4
|
+
version: 3.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: 2015-03-
|
11
|
+
date: 2015-03-10 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: 3.0.0
|
19
|
+
version: 3.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: 3.0.0
|
26
|
+
version: 3.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rabl
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -260,9 +260,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
260
260
|
version: '0'
|
261
261
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
262
262
|
requirements:
|
263
|
-
- - "
|
263
|
+
- - ">="
|
264
264
|
- !ruby/object:Gem::Version
|
265
|
-
version:
|
265
|
+
version: '0'
|
266
266
|
requirements: []
|
267
267
|
rubyforge_project:
|
268
268
|
rubygems_version: 2.4.5
|