spree_api 0.40.4 → 0.50.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +12 -1
- data/app/controllers/admin/users_controller_decorator.rb +1 -1
- data/app/controllers/api/base_controller.rb +4 -3
- data/app/controllers/api/inventory_units_controller.rb +1 -1
- data/app/controllers/api/line_items_controller.rb +1 -1
- data/app/controllers/api/products_controller.rb +2 -1
- data/config/cucumber.yml +2 -0
- metadata +13 -11
data/README.md
CHANGED
@@ -2,4 +2,15 @@ Spree API
|
|
2
2
|
=========
|
3
3
|
Manage orders,shipments etc. with a simple REST API
|
4
4
|
|
5
|
-
See [RESTful API guide](http://spreecommerce.com/documentation/rest.html) for more details.
|
5
|
+
See [RESTful API guide](http://spreecommerce.com/documentation/rest.html) for more details.
|
6
|
+
|
7
|
+
Testing
|
8
|
+
=======
|
9
|
+
|
10
|
+
Create the test site
|
11
|
+
|
12
|
+
rake test_app
|
13
|
+
|
14
|
+
Run the tests
|
15
|
+
|
16
|
+
rake spec
|
@@ -33,7 +33,7 @@ class Api::BaseController < Spree::BaseController
|
|
33
33
|
end
|
34
34
|
|
35
35
|
define_method :collection do
|
36
|
-
@collection ||= search.
|
36
|
+
@collection ||= search.relation.limit(100)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -72,8 +72,9 @@ class Api::BaseController < Spree::BaseController
|
|
72
72
|
|
73
73
|
def search
|
74
74
|
return @search unless @search.nil?
|
75
|
-
|
76
|
-
|
75
|
+
params[:search] = {} if params[:search].blank?
|
76
|
+
params[:search][:meta_sort] = 'created_at.desc' if params[:search][:meta_sort].blank?
|
77
|
+
@search = end_of_association_chain.metasearch(params[:search])
|
77
78
|
@search
|
78
79
|
end
|
79
80
|
|
@@ -5,7 +5,8 @@ class Api::ProductsController < Api::BaseController
|
|
5
5
|
|
6
6
|
private
|
7
7
|
define_method :collection do
|
8
|
-
@
|
8
|
+
@searcher = Spree::Config.searcher_class.new(params)
|
9
|
+
@collection = @searcher.retrieve_products
|
9
10
|
end
|
10
11
|
|
11
12
|
def object_serialization_options
|
data/config/cucumber.yml
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
3
3
|
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
4
4
|
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
|
5
|
+
ci_opts = "--format progress --strict"
|
5
6
|
%>
|
6
7
|
default: <%= std_opts %> features
|
7
8
|
wip: --tags @wip:3 --wip features
|
9
|
+
ci: <%= ci_opts %> features CI=true
|
8
10
|
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 215
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 50
|
9
|
+
- 0
|
10
|
+
version: 0.50.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David North
|
@@ -15,7 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-03-23 00:00:00 -04:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: spree_core
|
@@ -25,12 +26,12 @@ dependencies:
|
|
25
26
|
requirements:
|
26
27
|
- - "="
|
27
28
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
29
|
+
hash: 215
|
29
30
|
segments:
|
30
31
|
- 0
|
31
|
-
-
|
32
|
-
-
|
33
|
-
version: 0.
|
32
|
+
- 50
|
33
|
+
- 0
|
34
|
+
version: 0.50.0
|
34
35
|
type: :runtime
|
35
36
|
version_requirements: *id001
|
36
37
|
description: Required dependancy for Spree
|
@@ -64,6 +65,7 @@ files:
|
|
64
65
|
- lib/spree_api_hooks.rb
|
65
66
|
- lib/tasks/install.rake
|
66
67
|
- db/migrate/20100107141738_add_api_key_to_users.rb
|
68
|
+
has_rdoc: true
|
67
69
|
homepage: http://spreecommerce.com
|
68
70
|
licenses: []
|
69
71
|
|
@@ -95,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
97
|
requirements:
|
96
98
|
- none
|
97
99
|
rubyforge_project: spree_api
|
98
|
-
rubygems_version: 1.
|
100
|
+
rubygems_version: 1.3.7
|
99
101
|
signing_key:
|
100
102
|
specification_version: 3
|
101
103
|
summary: Provides RESTful access for Spree.
|