acfs 1.6.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +144 -115
- data/README.md +33 -41
- data/acfs.gemspec +9 -10
- data/lib/acfs/adapter/typhoeus.rb +6 -4
- data/lib/acfs/collections/paginatable.rb +11 -11
- data/lib/acfs/configuration.rb +13 -3
- data/lib/acfs/errors.rb +7 -7
- data/lib/acfs/global.rb +4 -4
- data/lib/acfs/location.rb +2 -2
- data/lib/acfs/operation.rb +1 -1
- data/lib/acfs/request/callbacks.rb +1 -1
- data/lib/acfs/request.rb +1 -1
- data/lib/acfs/resource/attributes/uuid.rb +2 -2
- data/lib/acfs/resource/attributes.rb +1 -1
- data/lib/acfs/resource/dirty.rb +1 -1
- data/lib/acfs/resource/locatable.rb +2 -2
- data/lib/acfs/resource/operational.rb +4 -4
- data/lib/acfs/resource/query_methods.rb +5 -5
- data/lib/acfs/response/status.rb +1 -1
- data/lib/acfs/runner.rb +15 -15
- data/lib/acfs/service/middleware.rb +2 -2
- data/lib/acfs/singleton_resource.rb +2 -2
- data/lib/acfs/stub.rb +35 -30
- data/lib/acfs/version.rb +3 -3
- data/lib/acfs/yard.rb +1 -0
- data/spec/acfs/adapter/typhoeus_spec.rb +4 -4
- data/spec/acfs/collection_spec.rb +66 -41
- data/spec/acfs/configuration_spec.rb +22 -12
- data/spec/acfs/global_spec.rb +14 -12
- data/spec/acfs/location_spec.rb +1 -1
- data/spec/acfs/middleware/json_spec.rb +9 -9
- data/spec/acfs/middleware/{msgpack_spec.rb → message_pack_spec.rb} +7 -7
- data/spec/acfs/operation_spec.rb +4 -3
- data/spec/acfs/request/callbacks_spec.rb +19 -10
- data/spec/acfs/request_spec.rb +15 -19
- data/spec/acfs/resource/attributes/boolean_spec.rb +32 -32
- data/spec/acfs/resource/attributes/date_time_spec.rb +17 -9
- data/spec/acfs/resource/attributes/dict_spec.rb +16 -10
- data/spec/acfs/resource/attributes/float_spec.rb +21 -11
- data/spec/acfs/resource/attributes/integer_spec.rb +11 -6
- data/spec/acfs/resource/attributes/list_spec.rb +13 -8
- data/spec/acfs/resource/attributes/uuid_spec.rb +14 -8
- data/spec/acfs/resource/attributes_spec.rb +33 -32
- data/spec/acfs/resource/dirty_spec.rb +7 -4
- data/spec/acfs/resource/initialization_spec.rb +4 -5
- data/spec/acfs/resource/loadable_spec.rb +3 -1
- data/spec/acfs/resource/locatable_spec.rb +24 -18
- data/spec/acfs/resource/{persistance_spec.rb → persistence_spec.rb} +119 -87
- data/spec/acfs/resource/query_methods_spec.rb +144 -111
- data/spec/acfs/resource/validation_spec.rb +34 -27
- data/spec/acfs/response/formats_spec.rb +8 -8
- data/spec/acfs/response/status_spec.rb +16 -9
- data/spec/acfs/runner_spec.rb +22 -20
- data/spec/acfs/service/middleware_spec.rb +3 -3
- data/spec/acfs/service_spec.rb +5 -4
- data/spec/acfs/singleton_resource_spec.rb +2 -1
- data/spec/acfs/stub_spec.rb +64 -65
- data/spec/acfs_spec.rb +112 -94
- data/spec/spec_helper.rb +10 -6
- data/spec/support/hash.rb +1 -1
- data/spec/support/response.rb +2 -2
- data/spec/support/service.rb +1 -1
- data/spec/support/shared/find_callbacks.rb +14 -10
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/README.md +23 -0
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/rubocop-config.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/CHANGELOG.md +205 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/README.rdoc +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/CHANGELOG.md +67 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/README.rdoc +40 -0
- data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/CHANGELOG.md +110 -0
- data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/README.rdoc +266 -0
- data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/CHANGELOG.md +157 -0
- data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/README.rdoc +40 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/CHANGELOG.md +301 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/LICENSE.txt +202 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/README.md +121 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/addressable.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/README.md +243 -0
- data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/appraisal.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/README.md +48 -0
- data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.0/README.md +138 -0
- data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.0/benchmark.gemspec +32 -0
- data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.1.9/LICENSE +56 -0
- data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.1.9/bigdecimal.gemspec +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/README.md +258 -0
- data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/builder.gemspec +49 -0
- data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/CHANGELOG.md +603 -0
- data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/LICENSE.txt +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/README.md +407 -0
- data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/README.md +167 -0
- data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/connection_pool.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/gems/crack-1.0.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/crack-1.0.0/README.md +43 -0
- data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/LICENSE +18 -0
- data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/README.md +192 -0
- data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/crass.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/License.md +41 -0
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/README.rdoc +84 -0
- data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/drb.gemspec +41 -0
- data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/CHANGELOG +111 -0
- data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/README.rdoc +151 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/CHANGELOG.md +375 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/README.md +118 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/ethon.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/CHANGELOG.md +465 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/LICENSE +24 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/LICENSE.SPECS +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/README.md +137 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/ffi.gemspec +42 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/LICENSE +19 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/README.md +298 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/changelog.md +119 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/hashdiff.gemspec +39 -0
- data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.6/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.6/README.md +127 -0
- data/vendor/bundle/ruby/3.4.0/gems/json-2.9.1/README.md +195 -0
- data/vendor/bundle/ruby/3.4.0/gems/json-2.9.1/json.gemspec +64 -0
- data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/README.md +104 -0
- data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/logger.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/CHANGELOG.md +591 -0
- data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/MIT-LICENSE.txt +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/README.md +410 -0
- data/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.4/README.rdoc +835 -0
- data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/CHANGELOG.md +275 -0
- data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/README.md +121 -0
- data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/LICENSE-DEPENDENCIES.md +2224 -0
- data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/LICENSE.md +9 -0
- data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/README.md +293 -0
- data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/CHANGELOG.md +491 -0
- data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/README.md +222 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/ChangeLog +846 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.ja.rdoc +58 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.rdoc +60 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/CHANGELOG.md +998 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/README.md +328 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-session-2.1.0/license.md +72 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-session-2.1.0/readme.md +47 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/MIT-LICENSE.txt +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/README.md +139 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.2.0/MIT-LICENSE +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.2.0/README.md +91 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/CHANGELOG.md +255 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/MIT-LICENSE +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/README.md +267 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/README.rdoc +155 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/rake.gemspec +101 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/README.md +107 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/rake-release.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.0/README.md +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.0/LICENSE.md +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.0/README.md +47 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/Changelog.md +68 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/LICENSE.txt +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/README.md +76 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/rspec-collection_matchers.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/Changelog.md +2415 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/LICENSE.md +26 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/README.md +389 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/Changelog.md +1352 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/LICENSE.md +25 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/README.md +326 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/Changelog.md +73 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/LICENSE.txt +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/README.md +104 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/rspec-its.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/Changelog.md +1299 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/LICENSE.md +25 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/README.md +465 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/Changelog.md +408 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/LICENSE.md +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/README.md +40 -0
- data/vendor/bundle/ruby/3.4.0/gems/securerandom-0.4.1/README.md +72 -0
- data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/README.md +45 -0
- data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/thor.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/CHANGELOG.md +410 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/LICENSE +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/README.md +588 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/typhoeus.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/LICENSE +19 -0
- data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/README.md +406 -0
- data/vendor/bundle/ruby/3.4.0/gems/uri-1.0.2/README.md +55 -0
- data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/README.md +42 -0
- data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/CHANGELOG.md +2104 -0
- data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/README.md +1222 -0
- data/vendor/bundle/ruby/3.4.0/specifications/actionpack-8.0.1.gemspec +36 -0
- data/vendor/bundle/ruby/3.4.0/specifications/actionview-8.0.1.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/activemodel-8.0.1.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/activesupport-8.0.1.gemspec +38 -0
- data/vendor/bundle/ruby/3.4.0/specifications/addressable-2.8.7.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/appraisal-2.5.0.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/base64-0.2.0.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/benchmark-0.4.0.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/bigdecimal-3.1.9.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/specifications/builder-3.3.0.gemspec +22 -0
- data/vendor/bundle/ruby/3.4.0/specifications/concurrent-ruby-1.3.5.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/connection_pool-2.5.0.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/crack-1.0.0.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/crass-1.0.6.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/diff-lcs-1.5.1.gemspec +37 -0
- data/vendor/bundle/ruby/3.4.0/specifications/drb-2.2.1.gemspec +22 -0
- data/vendor/bundle/ruby/3.4.0/specifications/erubi-1.13.1.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/ethon-0.16.0.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/ffi-1.17.1-x86_64-linux-gnu.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/hashdiff-1.1.2.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/i18n-1.14.6.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/json-2.9.1.gemspec +0 -0
- data/vendor/bundle/ruby/3.4.0/specifications/logger-1.6.5.gemspec +22 -0
- data/vendor/bundle/ruby/3.4.0/specifications/loofah-2.24.0.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/minitest-5.25.4.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/multi_json-1.15.0.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/nokogiri-1.18.1-x86_64-linux-gnu.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/public_suffix-6.0.1.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rack-3.1.8.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rack-session-2.1.0.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rack-test-2.2.0.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rails-dom-testing-2.2.0.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rails-html-sanitizer-1.6.2.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rake-13.2.1.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rake-release-1.3.0.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rexml-3.4.0.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-3.13.0.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-collection_matchers-1.2.1.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-core-3.13.2.gemspec +39 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-expectations-3.13.3.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-its-2.0.0.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-mocks-3.13.2.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-support-3.13.2.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/securerandom-0.4.1.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/thor-1.3.2.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/typhoeus-1.4.1.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/tzinfo-2.0.6.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/uri-1.0.2.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/useragent-0.16.11.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/specifications/webmock-3.24.0.gemspec +45 -0
- metadata +208 -70
@@ -4,16 +4,28 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe Acfs::Resource::Persistence do
|
6
6
|
let(:model_class) { MyUser }
|
7
|
-
before do
|
8
|
-
@get_stub = stub_request(:get, 'http://users.example.org/users/1').to_return response(id: 1, name: 'Anon', age: 12)
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
let!(:patch_stub) do
|
9
|
+
stub_request(:put, 'http://users.example.org/users/1')
|
10
|
+
.with(body: '{"id":1,"name":"Idefix","age":12}')
|
11
|
+
.to_return response(id: 1, name: 'Idefix', age: 12)
|
12
|
+
end
|
13
|
+
|
14
|
+
let!(:post_stub) do
|
15
|
+
stub_request(:post, 'http://users.example.org/users')
|
16
|
+
.with(body: '{"id":null,"name":"Idefix","age":12}')
|
17
|
+
.to_return response(id: 5, name: 'Idefix', age: 12)
|
18
|
+
end
|
19
|
+
|
20
|
+
let!(:delete_stub) do
|
21
|
+
stub_request(:delete, 'http://users.example.org/users/1')
|
22
|
+
.with(body: '{}')
|
23
|
+
.to_return response({id: 1, name: 'Idefix', age: 12}, {status: 200})
|
24
|
+
end
|
13
25
|
|
14
|
-
|
15
|
-
|
16
|
-
|
26
|
+
before do
|
27
|
+
stub_request(:get, 'http://users.example.org/users/1')
|
28
|
+
.to_return response(id: 1, name: 'Anon', age: 12)
|
17
29
|
|
18
30
|
stub_request(:post, 'http://users.example.org/users')
|
19
31
|
.with(body: '{"id":null,"name":"Anon","age":null}')
|
@@ -26,41 +38,38 @@ describe Acfs::Resource::Persistence do
|
|
26
38
|
stub_request(:post, 'http://users.example.org/users')
|
27
39
|
.with(body: '{"id":null,"name":null,"age":12}')
|
28
40
|
.to_return response({errors: {name: ['required']}}, {status: 422})
|
29
|
-
|
30
|
-
@del = stub_request(:delete, 'http://users.example.org/users/1')
|
31
|
-
.with(body: '{}')
|
32
|
-
.to_return response({id: 1, name: 'Idefix', age: 12}, {status: 200})
|
33
41
|
end
|
34
42
|
|
35
43
|
context 'new model' do
|
36
44
|
let(:model) { model_class.new }
|
37
45
|
|
38
|
-
it { expect(model).
|
46
|
+
it { expect(model).not_to be_persisted }
|
39
47
|
it { expect(model).to be_new }
|
40
48
|
|
41
49
|
describe '#save!' do
|
42
50
|
context 'when modified' do
|
43
51
|
let(:model) { model_class.find 1 }
|
52
|
+
|
44
53
|
before do
|
45
54
|
model
|
46
55
|
Acfs.run
|
47
56
|
model.name = 'Idefix'
|
48
57
|
end
|
49
58
|
|
50
|
-
it '
|
59
|
+
it 'PUTS to model URL' do
|
51
60
|
model.save!
|
52
61
|
|
53
|
-
expect(
|
62
|
+
expect(patch_stub).to have_been_requested
|
54
63
|
end
|
55
64
|
end
|
56
65
|
|
57
66
|
context 'when new' do
|
58
67
|
let(:model) { model_class.new name: 'Idefix', age: 12 }
|
59
68
|
|
60
|
-
it '
|
69
|
+
it 'POSTS to collection URL' do
|
61
70
|
model.save!
|
62
71
|
|
63
|
-
expect(
|
72
|
+
expect(post_stub).to have_been_requested
|
64
73
|
end
|
65
74
|
|
66
75
|
context 'with unknown attributes' do
|
@@ -71,17 +80,17 @@ describe Acfs::Resource::Persistence do
|
|
71
80
|
end
|
72
81
|
let(:model) { model_class.new name: 'Idefix', born_at: 'Berlin' }
|
73
82
|
|
74
|
-
it '
|
83
|
+
it 'POSTS to collection URL' do
|
75
84
|
model.save!
|
76
85
|
expect(req).to have_been_requested
|
77
86
|
end
|
78
87
|
|
79
|
-
it '
|
88
|
+
it 'stills have unknown attribute' do
|
80
89
|
model.save!
|
81
90
|
expect(model.attributes).to include 'born_at' => 'Berlin'
|
82
91
|
end
|
83
92
|
|
84
|
-
it '
|
93
|
+
it 'includes server send unknown attribute' do
|
85
94
|
model.save!
|
86
95
|
expect(model.attributes).to include 'wuff' => 'woa'
|
87
96
|
end
|
@@ -93,7 +102,7 @@ describe Acfs::Resource::Persistence do
|
|
93
102
|
before { model.save! }
|
94
103
|
|
95
104
|
it { expect(model).to be_persisted }
|
96
|
-
it { expect(model).
|
105
|
+
it { expect(model).not_to be_new }
|
97
106
|
end
|
98
107
|
end
|
99
108
|
|
@@ -101,46 +110,63 @@ describe Acfs::Resource::Persistence do
|
|
101
110
|
let!(:model) { model_class.find 1 }
|
102
111
|
|
103
112
|
describe '#update_attributes' do
|
104
|
-
|
105
|
-
|
113
|
+
it 'to raise error' do
|
114
|
+
expect do
|
115
|
+
model.update_attributes({name: 'John'})
|
116
|
+
end.to raise_error Acfs::ResourceNotLoaded
|
117
|
+
end
|
106
118
|
end
|
107
119
|
|
108
120
|
describe '#update_attributes!' do
|
109
|
-
|
110
|
-
|
121
|
+
it 'to raise error' do
|
122
|
+
expect do
|
123
|
+
model.update_attributes!({name: 'John'})
|
124
|
+
end.to raise_error Acfs::ResourceNotLoaded
|
125
|
+
end
|
111
126
|
end
|
112
127
|
end
|
113
128
|
|
114
129
|
context 'loaded model' do
|
115
130
|
context 'without changes' do
|
116
131
|
let(:model) { model_class.find 1 }
|
117
|
-
|
132
|
+
|
133
|
+
before do
|
134
|
+
model
|
135
|
+
Acfs.run
|
136
|
+
end
|
118
137
|
|
119
138
|
it { expect(model).to be_persisted }
|
120
|
-
it { expect(model).
|
139
|
+
it { expect(model).not_to be_new }
|
121
140
|
end
|
122
141
|
|
123
142
|
context 'with changes' do
|
124
143
|
let(:model) { model_class.find 1 }
|
125
|
-
|
144
|
+
|
145
|
+
before do
|
146
|
+
model
|
147
|
+
Acfs.run
|
148
|
+
model.name = 'dhh'
|
149
|
+
end
|
126
150
|
|
127
151
|
it { expect(model).to be_persisted }
|
128
|
-
it { expect(model).
|
152
|
+
it { expect(model).not_to be_new }
|
129
153
|
end
|
130
154
|
|
131
155
|
describe '#delete!' do
|
132
156
|
let(:model) { model_class.find 1 }
|
133
|
-
let(:before_acfs_run) {}
|
134
157
|
|
135
158
|
describe 'normal delete actions' do
|
136
|
-
before
|
159
|
+
before do
|
160
|
+
model
|
161
|
+
Acfs.run
|
162
|
+
end
|
137
163
|
|
138
|
-
it '
|
164
|
+
it 'triggers DELETE request' do
|
139
165
|
model.delete!
|
140
|
-
expect(
|
166
|
+
expect(delete_stub).to have_been_requested
|
141
167
|
end
|
142
168
|
|
143
|
-
it '
|
169
|
+
it 'is frozen after DELETE' do
|
144
170
|
model.delete!
|
145
171
|
expect(model.__getobj__).to be_frozen
|
146
172
|
end
|
@@ -149,46 +175,54 @@ describe Acfs::Resource::Persistence do
|
|
149
175
|
describe 'correct URL generation' do
|
150
176
|
let(:model_class) { PathArguments }
|
151
177
|
let(:model) { model_class.find 1, params: {required_arg: 'some_value'} }
|
178
|
+
let(:resource_url) { 'http://users.example.org/some_value/users/1' }
|
179
|
+
|
180
|
+
let!(:delete_stub) do
|
181
|
+
stub_request(:delete, resource_url)
|
182
|
+
.with(body: '{}')
|
183
|
+
.to_return response({id: 1, required_arg: 'some_value'}, {status: 200})
|
184
|
+
end
|
185
|
+
|
186
|
+
before do
|
187
|
+
stub_request(:get, resource_url)
|
188
|
+
.to_return response(id: 1, required_arg: 'some_value')
|
152
189
|
|
153
|
-
before :each do
|
154
|
-
resource_url = 'http://users.example.org/some_value/users/1'
|
155
|
-
@my_get_stub = stub_request(:get, resource_url)
|
156
|
-
.to_return response(id: 1, required_arg: 'some_value')
|
157
|
-
@my_delete_stub = stub_request(:delete, resource_url)
|
158
|
-
.with(body: '{}')
|
159
|
-
.to_return response({id: 1, required_arg: 'some_value'}, {status: 200})
|
160
190
|
model
|
161
191
|
Acfs.run
|
162
192
|
end
|
163
193
|
|
164
|
-
it '
|
194
|
+
it 'does not raise an error on URL generation' do
|
165
195
|
expect do
|
166
196
|
model.delete!
|
167
197
|
end.not_to raise_error
|
168
198
|
end
|
169
199
|
|
170
|
-
it '
|
200
|
+
it 'requests the delete' do
|
171
201
|
model.delete!
|
172
|
-
expect(
|
202
|
+
expect(delete_stub).to have_been_requested
|
173
203
|
end
|
174
204
|
end
|
175
205
|
end
|
176
206
|
|
177
207
|
describe '#update_atributes!' do
|
178
208
|
let(:model) { model_class.find 1 }
|
179
|
-
before { model; Acfs.run }
|
180
209
|
|
181
|
-
|
210
|
+
before do
|
211
|
+
model
|
212
|
+
Acfs.run
|
213
|
+
end
|
214
|
+
|
215
|
+
it 'sets attributes' do
|
182
216
|
model.update_attributes({name: 'Idefix'})
|
183
217
|
expect(model.attributes.symbolize_keys).to eq id: 1, name: 'Idefix', age: 12
|
184
218
|
end
|
185
219
|
|
186
|
-
it '
|
220
|
+
it 'saves resource' do
|
187
221
|
expect(model.__getobj__).to receive(:save)
|
188
222
|
model.update_attributes({name: 'Idefix'})
|
189
223
|
end
|
190
224
|
|
191
|
-
it '
|
225
|
+
it 'kwargses to save' do
|
192
226
|
expect(model.__getobj__).to receive(:save).with(bla: 'blub')
|
193
227
|
model.update_attributes({name: 'Idefix'}, bla: 'blub')
|
194
228
|
end
|
@@ -196,19 +230,23 @@ describe Acfs::Resource::Persistence do
|
|
196
230
|
|
197
231
|
describe '#update_atributes' do
|
198
232
|
let(:model) { model_class.find 1 }
|
199
|
-
before { model; Acfs.run }
|
200
233
|
|
201
|
-
|
234
|
+
before do
|
235
|
+
model
|
236
|
+
Acfs.run
|
237
|
+
end
|
238
|
+
|
239
|
+
it 'sets attributes' do
|
202
240
|
model.update_attributes!({name: 'Idefix'})
|
203
241
|
expect(model.attributes.symbolize_keys).to eq id: 1, name: 'Idefix', age: 12
|
204
242
|
end
|
205
243
|
|
206
|
-
it '
|
244
|
+
it 'saves resource' do
|
207
245
|
expect(model.__getobj__).to receive(:save!)
|
208
246
|
model.update_attributes!({name: 'Idefix'})
|
209
247
|
end
|
210
248
|
|
211
|
-
it '
|
249
|
+
it 'passes second hash to save' do
|
212
250
|
expect(model.__getobj__).to receive(:save!).with(bla: 'blub')
|
213
251
|
model.update_attributes!({name: 'Idefix'}, bla: 'blub')
|
214
252
|
end
|
@@ -218,7 +256,11 @@ describe Acfs::Resource::Persistence do
|
|
218
256
|
describe '.save!' do
|
219
257
|
context 'with invalid data validated on server side' do
|
220
258
|
let(:model) { model_class.find 1 }
|
221
|
-
|
259
|
+
|
260
|
+
before do
|
261
|
+
model
|
262
|
+
Acfs.run
|
263
|
+
end
|
222
264
|
|
223
265
|
before do
|
224
266
|
stub_request(:put, 'http://users.example.org/users/1')
|
@@ -226,25 +268,14 @@ describe Acfs::Resource::Persistence do
|
|
226
268
|
.to_return response({errors: {name: ['required']}}, {status: 422})
|
227
269
|
end
|
228
270
|
|
229
|
-
it '
|
271
|
+
it 'sets local errors hash' do
|
230
272
|
model.name = ''
|
231
273
|
begin
|
232
274
|
model.save!
|
233
275
|
rescue StandardError
|
234
276
|
nil
|
235
277
|
end
|
236
|
-
expect(model.errors.to_hash).to
|
237
|
-
end
|
238
|
-
end
|
239
|
-
|
240
|
-
context 'hash modification on iteration in ActiveModel when errors on field is nil' do
|
241
|
-
let(:model) { model_class.find 1 }
|
242
|
-
before { model; Acfs.run }
|
243
|
-
|
244
|
-
before do
|
245
|
-
stub_request(:put, 'http://users.example.org/users/1')
|
246
|
-
.with(body: '{"id":1,"name":"","age":12}')
|
247
|
-
.to_return response({errors: {name: ['required']}}, {status: 422})
|
278
|
+
expect(model.errors.to_hash).to eq({name: %w[required]})
|
248
279
|
end
|
249
280
|
end
|
250
281
|
end
|
@@ -253,13 +284,13 @@ describe Acfs::Resource::Persistence do
|
|
253
284
|
context 'with valid data' do
|
254
285
|
let(:data) { {name: 'Idefix', age: 12} }
|
255
286
|
|
256
|
-
it '
|
287
|
+
it 'creates new resource' do
|
257
288
|
model = model_class.create! data
|
258
|
-
expect(model.name).to
|
259
|
-
expect(model.age).to
|
289
|
+
expect(model.name).to eq 'Idefix'
|
290
|
+
expect(model.age).to eq 12
|
260
291
|
end
|
261
292
|
|
262
|
-
it '
|
293
|
+
it 'is persisted' do
|
263
294
|
model = model_class.create! data
|
264
295
|
expect(model).to be_persisted
|
265
296
|
end
|
@@ -268,54 +299,55 @@ describe Acfs::Resource::Persistence do
|
|
268
299
|
context 'with invalid data' do
|
269
300
|
let(:data) { {name: nil, age: 12} }
|
270
301
|
|
271
|
-
it '
|
302
|
+
it 'raises an error' do
|
272
303
|
expect { model_class.create! data }.to \
|
273
|
-
raise_error(
|
274
|
-
expect(error.errors).to
|
304
|
+
raise_error(Acfs::InvalidResource) do |error|
|
305
|
+
expect(error.errors).to eq({'name' => %w[required]})
|
275
306
|
end
|
276
307
|
end
|
277
308
|
end
|
278
309
|
end
|
279
310
|
|
280
311
|
describe '.create' do
|
281
|
-
subject { model_class.create data }
|
312
|
+
subject(:model) { model_class.create data }
|
282
313
|
|
283
314
|
context 'with valid data' do
|
284
315
|
let(:data) { {name: 'Idefix', age: 12} }
|
285
316
|
|
286
|
-
it '
|
287
|
-
expect(
|
288
|
-
expect(
|
317
|
+
it 'creates new resource' do
|
318
|
+
expect(model.name).to eq 'Idefix'
|
319
|
+
expect(model.age).to eq 12
|
289
320
|
end
|
290
321
|
|
291
|
-
it '
|
292
|
-
expect(
|
322
|
+
it 'is persisted' do
|
323
|
+
expect(model).to be_persisted
|
293
324
|
end
|
294
325
|
end
|
295
326
|
|
296
327
|
context 'with invalid data' do
|
297
328
|
let(:data) { {name: nil, age: 12} }
|
298
329
|
|
299
|
-
it '
|
300
|
-
expect(
|
330
|
+
it 'returns not persisted resource' do
|
331
|
+
expect(model).not_to be_persisted
|
301
332
|
end
|
302
333
|
|
303
|
-
it '
|
304
|
-
expect(
|
334
|
+
it 'contains error hash' do
|
335
|
+
expect(model.errors.to_hash).to eq name: %w[required]
|
305
336
|
end
|
306
337
|
end
|
307
338
|
|
308
339
|
context 'with additional data' do
|
309
|
-
|
340
|
+
before do
|
310
341
|
stub_request(:post, 'http://users.example.org/users')
|
311
342
|
.with(body: '{"id":null,"name":"Anon","age":9,"born_at":"today"}')
|
312
343
|
.to_return response(id: 5, name: 'Anon', age: 9)
|
313
344
|
end
|
345
|
+
|
314
346
|
let(:data) { {age: 9, born_at: 'today'} }
|
315
347
|
|
316
|
-
it '
|
317
|
-
expect(
|
318
|
-
|
348
|
+
it 'stores them in attributes' do
|
349
|
+
expect(model.attributes).to eq 'id' => 5, 'name' => 'Anon',
|
350
|
+
'age' => 9, 'born_at' => 'today'
|
319
351
|
end
|
320
352
|
end
|
321
353
|
end
|