spree_api 3.1.5 → 3.1.6

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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/spree/api/v1/product_properties_controller.rb +7 -10
  3. data/app/views/spree/api/v1/countries/index.v1.rabl +1 -1
  4. data/app/views/spree/api/v1/credit_cards/index.v1.rabl +1 -1
  5. data/app/views/spree/api/v1/orders/index.v1.rabl +1 -1
  6. data/app/views/spree/api/v1/orders/mine.v1.rabl +1 -1
  7. data/app/views/spree/api/v1/payments/index.v1.rabl +1 -1
  8. data/app/views/spree/api/v1/product_properties/index.v1.rabl +1 -1
  9. data/app/views/spree/api/v1/products/index.v1.rabl +1 -1
  10. data/app/views/spree/api/v1/properties/index.v1.rabl +1 -1
  11. data/app/views/spree/api/v1/return_authorizations/index.v1.rabl +1 -1
  12. data/app/views/spree/api/v1/shipments/mine.v1.rabl +1 -1
  13. data/app/views/spree/api/v1/states/index.v1.rabl +1 -1
  14. data/app/views/spree/api/v1/stock_items/index.v1.rabl +1 -1
  15. data/app/views/spree/api/v1/stock_locations/index.v1.rabl +1 -1
  16. data/app/views/spree/api/v1/stock_movements/index.v1.rabl +1 -1
  17. data/app/views/spree/api/v1/taxonomies/index.v1.rabl +1 -1
  18. data/app/views/spree/api/v1/taxons/index.v1.rabl +1 -1
  19. data/app/views/spree/api/v1/users/index.v1.rabl +1 -1
  20. data/app/views/spree/api/v1/zones/index.v1.rabl +1 -1
  21. data/spree_api.gemspec +1 -2
  22. metadata +6 -88
  23. data/spec/controllers/spree/api/base_controller_spec.rb +0 -96
  24. data/spec/controllers/spree/api/v1/addresses_controller_spec.rb +0 -56
  25. data/spec/controllers/spree/api/v1/checkouts_controller_spec.rb +0 -363
  26. data/spec/controllers/spree/api/v1/classifications_controller_spec.rb +0 -48
  27. data/spec/controllers/spree/api/v1/countries_controller_spec.rb +0 -48
  28. data/spec/controllers/spree/api/v1/credit_cards_controller_spec.rb +0 -80
  29. data/spec/controllers/spree/api/v1/images_controller_spec.rb +0 -115
  30. data/spec/controllers/spree/api/v1/inventory_units_controller_spec.rb +0 -49
  31. data/spec/controllers/spree/api/v1/line_items_controller_spec.rb +0 -184
  32. data/spec/controllers/spree/api/v1/option_types_controller_spec.rb +0 -122
  33. data/spec/controllers/spree/api/v1/option_values_controller_spec.rb +0 -141
  34. data/spec/controllers/spree/api/v1/orders_controller_spec.rb +0 -735
  35. data/spec/controllers/spree/api/v1/payments_controller_spec.rb +0 -234
  36. data/spec/controllers/spree/api/v1/product_properties_controller_spec.rb +0 -116
  37. data/spec/controllers/spree/api/v1/products_controller_spec.rb +0 -409
  38. data/spec/controllers/spree/api/v1/promotion_application_spec.rb +0 -50
  39. data/spec/controllers/spree/api/v1/promotions_controller_spec.rb +0 -64
  40. data/spec/controllers/spree/api/v1/properties_controller_spec.rb +0 -102
  41. data/spec/controllers/spree/api/v1/return_authorizations_controller_spec.rb +0 -161
  42. data/spec/controllers/spree/api/v1/shipments_controller_spec.rb +0 -187
  43. data/spec/controllers/spree/api/v1/states_controller_spec.rb +0 -86
  44. data/spec/controllers/spree/api/v1/stock_items_controller_spec.rb +0 -143
  45. data/spec/controllers/spree/api/v1/stock_locations_controller_spec.rb +0 -113
  46. data/spec/controllers/spree/api/v1/stock_movements_controller_spec.rb +0 -84
  47. data/spec/controllers/spree/api/v1/stores_controller_spec.rb +0 -133
  48. data/spec/controllers/spree/api/v1/taxonomies_controller_spec.rb +0 -114
  49. data/spec/controllers/spree/api/v1/taxons_controller_spec.rb +0 -177
  50. data/spec/controllers/spree/api/v1/unauthenticated_products_controller_spec.rb +0 -26
  51. data/spec/controllers/spree/api/v1/users_controller_spec.rb +0 -153
  52. data/spec/controllers/spree/api/v1/variants_controller_spec.rb +0 -205
  53. data/spec/controllers/spree/api/v1/zones_controller_spec.rb +0 -91
  54. data/spec/fixtures/thinking-cat.jpg +0 -0
  55. data/spec/models/spree/legacy_user_spec.rb +0 -19
  56. data/spec/requests/rabl_cache_spec.rb +0 -32
  57. data/spec/requests/ransackable_attributes_spec.rb +0 -79
  58. data/spec/requests/version_spec.rb +0 -19
  59. data/spec/shared_examples/protect_product_actions.rb +0 -17
  60. data/spec/spec_helper.rb +0 -55
  61. data/spec/support/controller_hacks.rb +0 -33
  62. data/spec/support/database_cleaner.rb +0 -14
  63. data/spec/support/have_attributes_matcher.rb +0 -13
@@ -1,17 +0,0 @@
1
- shared_examples "modifying product actions are restricted" do
2
- it "cannot create a new product if not an admin" do
3
- api_post :create, :product => { :name => "Brand new product!" }
4
- assert_unauthorized!
5
- end
6
-
7
- it "cannot update a product" do
8
- api_put :update, :id => product.to_param, :product => { :name => "I hacked your store!" }
9
- assert_unauthorized!
10
- end
11
-
12
- it "cannot delete a product" do
13
- api_delete :destroy, :id => product.to_param
14
- assert_unauthorized!
15
- end
16
- end
17
-
data/spec/spec_helper.rb DELETED
@@ -1,55 +0,0 @@
1
- if ENV["COVERAGE"]
2
- # Run Coverage report
3
- require 'simplecov'
4
- SimpleCov.start do
5
- add_group 'Controllers', 'app/controllers'
6
- add_group 'Helpers', 'app/helpers'
7
- add_group 'Mailers', 'app/mailers'
8
- add_group 'Models', 'app/models'
9
- add_group 'Views', 'app/views'
10
- add_group 'Libraries', 'lib'
11
- end
12
- end
13
-
14
- # This file is copied to spec/ when you run 'rails generate rspec:install'
15
- ENV["RAILS_ENV"] ||= 'test'
16
-
17
- begin
18
- require File.expand_path("../dummy/config/environment", __FILE__)
19
- rescue LoadError
20
- puts "Could not load dummy application. Please ensure you have run `bundle exec rake test_app`"
21
- exit
22
- end
23
-
24
- require 'rspec/rails'
25
- require 'ffaker'
26
-
27
- # Requires supporting ruby files with custom matchers and macros, etc,
28
- # in spec/support/ and its subdirectories.
29
- Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
30
-
31
- require 'spree/testing_support/factories'
32
- require 'spree/testing_support/preferences'
33
-
34
- require 'spree/api/testing_support/caching'
35
- require 'spree/api/testing_support/helpers'
36
- require 'spree/api/testing_support/setup'
37
- require 'spree/testing_support/shoulda_matcher_configuration'
38
-
39
- RSpec.configure do |config|
40
- config.backtrace_exclusion_patterns = [/gems\/activesupport/, /gems\/actionpack/, /gems\/rspec/]
41
- config.color = true
42
- config.fail_fast = ENV['FAIL_FAST'] || false
43
- config.infer_spec_type_from_file_location!
44
- config.raise_errors_for_deprecations!
45
- config.use_transactional_fixtures = true
46
-
47
- config.include FactoryGirl::Syntax::Methods
48
- config.include Spree::Api::TestingSupport::Helpers, :type => :controller
49
- config.extend Spree::Api::TestingSupport::Setup, :type => :controller
50
- config.include Spree::TestingSupport::Preferences, :type => :controller
51
-
52
- config.before do
53
- Spree::Api::Config[:requires_authentication] = true
54
- end
55
- end
@@ -1,33 +0,0 @@
1
- require 'active_support/all'
2
- module ControllerHacks
3
- extend ActiveSupport::Concern
4
-
5
- included do
6
- routes { Spree::Core::Engine.routes }
7
- end
8
-
9
- def api_get(action, params={}, session=nil, flash=nil)
10
- api_process(action, params, session, flash, "GET")
11
- end
12
-
13
- def api_post(action, params={}, session=nil, flash=nil)
14
- api_process(action, params, session, flash, "POST")
15
- end
16
-
17
- def api_put(action, params={}, session=nil, flash=nil)
18
- api_process(action, params, session, flash, "PUT")
19
- end
20
-
21
- def api_delete(action, params={}, session=nil, flash=nil)
22
- api_process(action, params, session, flash, "DELETE")
23
- end
24
-
25
- def api_process(action, params={}, session=nil, flash=nil, method="get")
26
- scoping = respond_to?(:resource_scoping) ? resource_scoping : {}
27
- process(action, method, params.merge(scoping).reverse_merge!(:format => :json), session, flash)
28
- end
29
- end
30
-
31
- RSpec.configure do |config|
32
- config.include ControllerHacks, type: :controller
33
- end
@@ -1,14 +0,0 @@
1
- RSpec.configure do |config|
2
- config.before(:suite) do
3
- DatabaseCleaner.strategy = :transaction
4
- DatabaseCleaner.clean_with(:truncation)
5
- end
6
-
7
- config.before(:each) do
8
- DatabaseCleaner.start
9
- end
10
-
11
- config.after(:each) do
12
- DatabaseCleaner.clean
13
- end
14
- end
@@ -1,13 +0,0 @@
1
-
2
-
3
-
4
-
5
- RSpec::Matchers.define :have_attributes do |expected_attributes|
6
- match do |actual|
7
- # actual is a Hash object representing an object, like this:
8
- # { "name" => "Product #1" }
9
- actual_attributes = actual.keys.map(&:to_sym)
10
- expected_attributes.map(&:to_sym).all? { |attr| actual_attributes.include?(attr) }
11
- end
12
- end
13
-