acfs 1.6.0 → 2.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 +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
@@ -13,32 +13,33 @@ describe Acfs::Resource::QueryMethods do
|
|
13
13
|
.to_return response id: 1, name: 'Anon', age: 12, born_at: 'Berlin'
|
14
14
|
stub_request(:get, 'http://users.example.org/users/2')
|
15
15
|
.to_return response id: 2, type: 'Customer',
|
16
|
-
|
16
|
+
name: 'Clare Customer', age: 24
|
17
17
|
end
|
18
18
|
|
19
19
|
let(:action) { ->(cb = nil) { model.find(1, &cb) } }
|
20
|
+
|
20
21
|
it_behaves_like 'a query method with multi-callback support'
|
21
22
|
|
22
|
-
it '
|
23
|
+
it 'loads a single remote resource' do
|
23
24
|
user = action.call
|
24
25
|
Acfs.run
|
25
26
|
|
26
27
|
expect(user.attributes).to eq id: 1, name: 'Anon',
|
27
|
-
|
28
|
+
age: 12, born_at: 'Berlin'
|
28
29
|
end
|
29
30
|
|
30
31
|
context 'with resource type inheritance' do
|
31
|
-
|
32
|
-
|
32
|
+
subject!(:user) { MyUser.find 2 }
|
33
|
+
|
33
34
|
before { Acfs.run }
|
34
35
|
|
35
|
-
it '
|
36
|
-
expect(
|
36
|
+
it 'respects resource type inheritance' do
|
37
|
+
expect(user).to be_a Customer
|
37
38
|
end
|
38
39
|
|
39
|
-
it '
|
40
|
-
expect(
|
41
|
-
expect(
|
40
|
+
it 'implements ActiveModel class interface' do
|
41
|
+
expect(user.class).to be_a ActiveModel::Naming
|
42
|
+
expect(user.class).to be_a ActiveModel::Translation
|
42
43
|
end
|
43
44
|
end
|
44
45
|
end
|
@@ -49,12 +50,12 @@ describe Acfs::Resource::QueryMethods do
|
|
49
50
|
.to_return response({error: 'not found'}, {status: 404})
|
50
51
|
end
|
51
52
|
|
52
|
-
it '
|
53
|
-
|
53
|
+
it 'raises a NotFound error' do
|
54
|
+
user = model.find 1
|
54
55
|
|
55
56
|
expect { Acfs.run }.to raise_error(Acfs::ResourceNotFound)
|
56
57
|
|
57
|
-
expect(
|
58
|
+
expect(user).not_to be_loaded
|
58
59
|
end
|
59
60
|
end
|
60
61
|
|
@@ -64,12 +65,12 @@ describe Acfs::Resource::QueryMethods do
|
|
64
65
|
.to_return response(nil, status: 500)
|
65
66
|
end
|
66
67
|
|
67
|
-
it '
|
68
|
-
|
68
|
+
it 'raises a response error' do
|
69
|
+
user = model.find 1
|
69
70
|
|
70
71
|
expect { Acfs.run }.to raise_error(Acfs::ErroneousResponse)
|
71
72
|
|
72
|
-
expect(
|
73
|
+
expect(user).not_to be_loaded
|
73
74
|
end
|
74
75
|
end
|
75
76
|
end
|
@@ -87,47 +88,49 @@ describe Acfs::Resource::QueryMethods do
|
|
87
88
|
end
|
88
89
|
|
89
90
|
context 'with successful response' do
|
90
|
-
it '
|
91
|
+
it 'loads a multiple remote resources' do
|
91
92
|
users = model.find([1, 2])
|
92
93
|
Acfs.run
|
93
94
|
|
94
|
-
expect(users.size).to
|
95
|
+
expect(users.size).to eq 2
|
95
96
|
expect(users[0].attributes).to eq id: 1, name: 'Anon', age: 12
|
96
97
|
expect(users[1].attributes).to eq id: 2, name: 'Johnny', age: 42
|
97
98
|
end
|
98
99
|
|
99
|
-
it '
|
100
|
+
it 'invokes callback after all models are loaded' do
|
100
101
|
block = proc {}
|
102
|
+
|
101
103
|
expect(block).to receive(:call) do |users|
|
102
|
-
expect(users).to equal
|
103
|
-
expect(users.size).to
|
104
|
+
expect(users).to equal users
|
105
|
+
expect(users.size).to eq 2
|
104
106
|
expect(users).to be_loaded
|
105
107
|
end
|
106
108
|
|
107
|
-
|
109
|
+
users = model.find([1, 2], &block) # rubocop:disable Lint/UselessAssignment
|
108
110
|
Acfs.run
|
109
111
|
end
|
110
112
|
|
111
|
-
it '
|
113
|
+
it 'invokes multiple callback after all models are loaded' do
|
112
114
|
proc1 = proc {}
|
113
115
|
proc2 = proc {}
|
116
|
+
|
114
117
|
expect(proc1).to receive(:call) do |users|
|
115
|
-
expect(users).to equal
|
116
|
-
expect(users.size).to
|
118
|
+
expect(users).to equal users
|
119
|
+
expect(users.size).to eq 2
|
117
120
|
expect(users).to be_loaded
|
118
121
|
end
|
119
122
|
expect(proc2).to receive(:call) do |users|
|
120
|
-
expect(users).to equal
|
121
|
-
expect(users.size).to
|
123
|
+
expect(users).to equal users
|
124
|
+
expect(users.size).to eq 2
|
122
125
|
expect(users).to be_loaded
|
123
126
|
end
|
124
127
|
|
125
|
-
|
126
|
-
Acfs.add_callback(
|
128
|
+
users = model.find([1, 2], &proc1)
|
129
|
+
Acfs.add_callback(users, &proc2)
|
127
130
|
Acfs.run
|
128
131
|
end
|
129
132
|
|
130
|
-
it '
|
133
|
+
it 'respects resource type inheritance' do
|
131
134
|
customers = MyUser.find [3, 4]
|
132
135
|
Acfs.run
|
133
136
|
|
@@ -142,7 +145,7 @@ describe Acfs::Resource::QueryMethods do
|
|
142
145
|
.to_return response({error: 'not found'}, {status: 404})
|
143
146
|
end
|
144
147
|
|
145
|
-
it '
|
148
|
+
it 'raises resource not found error' do
|
146
149
|
model.find [1, 2]
|
147
150
|
|
148
151
|
expect { Acfs.run }.to raise_error(Acfs::ResourceNotFound)
|
@@ -155,52 +158,54 @@ describe Acfs::Resource::QueryMethods do
|
|
155
158
|
let(:computer) { Computer }
|
156
159
|
let(:pc) { PC }
|
157
160
|
let(:mac) { Mac }
|
161
|
+
|
158
162
|
before do
|
159
163
|
stub_request(:get, 'http://computers.example.org/computers')
|
160
164
|
.to_return response [
|
161
165
|
{id: 1, type: 'PC'},
|
162
166
|
{id: 2, type: 'Computer'},
|
163
|
-
{id: 3, type: 'Mac'}
|
167
|
+
{id: 3, type: 'Mac'},
|
164
168
|
]
|
165
169
|
end
|
166
170
|
|
167
|
-
it '
|
171
|
+
it 'invokes multiple callback after all models are loaded' do
|
168
172
|
proc1 = proc {}
|
169
173
|
proc2 = proc {}
|
174
|
+
|
170
175
|
expect(proc1).to receive(:call) do |computers|
|
171
|
-
expect(computers).to equal
|
172
|
-
expect(computers.size).to
|
176
|
+
expect(computers).to equal computers
|
177
|
+
expect(computers.size).to eq 3
|
173
178
|
expect(computers).to be_loaded
|
174
179
|
end
|
175
180
|
expect(proc2).to receive(:call) do |computers|
|
176
|
-
expect(computers).to equal
|
177
|
-
expect(computers.size).to
|
181
|
+
expect(computers).to equal computers
|
182
|
+
expect(computers.size).to eq 3
|
178
183
|
expect(computers).to be_loaded
|
179
184
|
end
|
180
185
|
|
181
|
-
|
182
|
-
Acfs.add_callback(
|
186
|
+
computers = computer.all(&proc1)
|
187
|
+
Acfs.add_callback(computers, &proc2)
|
183
188
|
Acfs.run
|
184
189
|
end
|
185
190
|
|
186
191
|
context 'with resource type inheritance' do
|
187
|
-
it '
|
188
|
-
|
192
|
+
it 'creates appropriate subclass resources' do
|
193
|
+
computers = Computer.all
|
189
194
|
|
190
|
-
expect(
|
195
|
+
expect(computers).not_to be_loaded
|
191
196
|
|
192
197
|
Acfs.run
|
193
198
|
|
194
|
-
expect(
|
195
|
-
expect(
|
196
|
-
expect(
|
197
|
-
expect(
|
198
|
-
expect(
|
199
|
+
expect(computers).to be_loaded
|
200
|
+
expect(computers).to have(3).items
|
201
|
+
expect(computers[0]).to be_a PC
|
202
|
+
expect(computers[1]).to be_a Computer
|
203
|
+
expect(computers[2]).to be_a Mac
|
199
204
|
end
|
200
205
|
|
201
206
|
context 'with invalid type set' do
|
202
207
|
shared_examples 'with invalid type' do
|
203
|
-
it '
|
208
|
+
it 'raises error if type is no subclass' do
|
204
209
|
Computer.all
|
205
210
|
expect { Acfs.run }.to raise_error(Acfs::ResourceTypeError)
|
206
211
|
end
|
@@ -212,9 +217,10 @@ describe Acfs::Resource::QueryMethods do
|
|
212
217
|
.to_return response [
|
213
218
|
{id: 1, type: 'MyUser'},
|
214
219
|
{id: 2, type: 'Computer'},
|
215
|
-
{id: 3, type: 'Mac'}
|
220
|
+
{id: 3, type: 'Mac'},
|
216
221
|
]
|
217
222
|
end
|
223
|
+
|
218
224
|
it_behaves_like 'with invalid type'
|
219
225
|
end
|
220
226
|
|
@@ -224,9 +230,10 @@ describe Acfs::Resource::QueryMethods do
|
|
224
230
|
.to_return response [
|
225
231
|
{id: 1, type: 'PC'},
|
226
232
|
{id: 2, type: 'noValidType'},
|
227
|
-
{id: 3, type: 'Mac'}
|
233
|
+
{id: 3, type: 'Mac'},
|
228
234
|
]
|
229
235
|
end
|
236
|
+
|
230
237
|
it_behaves_like 'with invalid type'
|
231
238
|
end
|
232
239
|
|
@@ -236,9 +243,10 @@ describe Acfs::Resource::QueryMethods do
|
|
236
243
|
.to_return response [
|
237
244
|
{id: 1, type: 'PC'},
|
238
245
|
{id: 2, type: 'Computer'},
|
239
|
-
{id: 3, type: 42}
|
246
|
+
{id: 3, type: 42},
|
240
247
|
]
|
241
248
|
end
|
249
|
+
|
242
250
|
it_behaves_like 'with invalid type'
|
243
251
|
end
|
244
252
|
end
|
@@ -247,15 +255,16 @@ describe Acfs::Resource::QueryMethods do
|
|
247
255
|
|
248
256
|
shared_examples 'find_by' do
|
249
257
|
context 'standard resource' do
|
258
|
+
subject { Acfs.run && user }
|
259
|
+
|
250
260
|
let(:model) { MyUser }
|
251
261
|
let!(:user) { model.send described_method, age: 24 }
|
252
|
-
subject { Acfs.run && user }
|
253
262
|
|
254
263
|
context 'return value' do
|
255
264
|
subject { user }
|
256
265
|
|
257
|
-
it {
|
258
|
-
it {
|
266
|
+
it { is_expected.to be_a MyUser }
|
267
|
+
it { is_expected.not_to be_loaded }
|
259
268
|
end
|
260
269
|
|
261
270
|
context 'with params' do
|
@@ -264,7 +273,7 @@ describe Acfs::Resource::QueryMethods do
|
|
264
273
|
.to_return response([{id: 1, name: 'Mike', age: 24}])
|
265
274
|
end
|
266
275
|
|
267
|
-
it '
|
276
|
+
it 'includes params in URI to index action' do
|
268
277
|
subject
|
269
278
|
expect(request).to have_been_requested
|
270
279
|
end
|
@@ -276,45 +285,45 @@ describe Acfs::Resource::QueryMethods do
|
|
276
285
|
.to_return response [
|
277
286
|
{id: 1, name: 'Mike', age: 24},
|
278
287
|
{id: 4, type: 'Maria', age: 24},
|
279
|
-
{id: 7, type: 'James', age: 24}
|
288
|
+
{id: 7, type: 'James', age: 24},
|
280
289
|
]
|
281
290
|
end
|
282
291
|
|
283
|
-
it '
|
292
|
+
it 'invokes callback after model is loaded' do
|
284
293
|
block = proc {}
|
285
294
|
|
286
295
|
expect(block).to receive(:call) do |user|
|
287
|
-
expect(user).to eql
|
296
|
+
expect(user).to eql user.__getobj__
|
288
297
|
expect(user).to be_a MyUser
|
289
298
|
expect(user).to be_loaded
|
290
299
|
end
|
291
300
|
|
292
|
-
|
301
|
+
user = model.send described_method, age: 24, &block # rubocop:disable Lint/UselessAssignment
|
293
302
|
Acfs.run
|
294
303
|
end
|
295
304
|
|
296
|
-
it '
|
305
|
+
it 'invokes multiple callbacks after model is loaded' do
|
297
306
|
proc1 = proc {}
|
298
307
|
proc2 = proc {}
|
299
308
|
|
300
309
|
expect(proc1).to receive(:call) do |user|
|
301
|
-
expect(user).to eql
|
310
|
+
expect(user).to eql user.__getobj__
|
302
311
|
expect(user).to be_a MyUser
|
303
312
|
expect(user).to be_loaded
|
304
313
|
end
|
305
314
|
|
306
315
|
expect(proc2).to receive(:call) do |user|
|
307
|
-
expect(user).to eql
|
316
|
+
expect(user).to eql user.__getobj__
|
308
317
|
expect(user).to be_a MyUser
|
309
318
|
expect(user).to be_loaded
|
310
319
|
end
|
311
320
|
|
312
|
-
|
313
|
-
Acfs.add_callback
|
321
|
+
user = model.send described_method, age: 24, &proc1
|
322
|
+
Acfs.add_callback user, &proc2
|
314
323
|
Acfs.run
|
315
324
|
end
|
316
325
|
|
317
|
-
it '
|
326
|
+
it 'loads a single MyUser object' do
|
318
327
|
expect(subject).to be_a MyUser
|
319
328
|
end
|
320
329
|
end
|
@@ -324,19 +333,21 @@ describe Acfs::Resource::QueryMethods do
|
|
324
333
|
let(:model) { Single }
|
325
334
|
|
326
335
|
it '.find_by should not be defined' do
|
327
|
-
expect { model.find_by }.to raise_error
|
336
|
+
expect { model.find_by }.to raise_error Acfs::UnsupportedOperation
|
328
337
|
end
|
329
338
|
end
|
330
339
|
end
|
331
340
|
|
332
341
|
describe '.find_by' do
|
333
342
|
let(:described_method) { :find_by }
|
343
|
+
|
334
344
|
it_behaves_like 'find_by'
|
335
345
|
|
336
346
|
context 'standard resource' do
|
347
|
+
subject { Acfs.run && user }
|
348
|
+
|
337
349
|
let(:model) { MyUser }
|
338
350
|
let!(:user) { model.send described_method, age: 24 }
|
339
|
-
subject { Acfs.run && user }
|
340
351
|
|
341
352
|
context 'with empty response' do
|
342
353
|
before do
|
@@ -344,35 +355,35 @@ describe Acfs::Resource::QueryMethods do
|
|
344
355
|
.to_return response []
|
345
356
|
end
|
346
357
|
|
347
|
-
it {
|
358
|
+
it { is_expected.to be_nil }
|
348
359
|
|
349
|
-
it '
|
360
|
+
it 'invokes callback after model is loaded' do
|
350
361
|
block = proc {}
|
351
362
|
|
352
363
|
expect(block).to receive(:call) do |user|
|
353
|
-
expect(user).to eql
|
364
|
+
expect(user).to eql user.__getobj__
|
354
365
|
expect(user).to be_a NilClass
|
355
366
|
end
|
356
367
|
|
357
|
-
|
368
|
+
user = model.find_by age: 24, &block # rubocop:disable Lint/UselessAssignment
|
358
369
|
Acfs.run
|
359
370
|
end
|
360
371
|
|
361
|
-
it '
|
372
|
+
it 'invokes multiple callbacks after model is loaded' do
|
362
373
|
proc1 = proc {}
|
363
374
|
proc2 = proc {}
|
364
375
|
|
365
376
|
expect(proc1).to receive(:call) do |user|
|
366
|
-
expect(user).to eql
|
377
|
+
expect(user).to eql user.__getobj__
|
367
378
|
expect(user).to be_a NilClass
|
368
379
|
end
|
369
380
|
expect(proc2).to receive(:call) do |user|
|
370
|
-
expect(user).to eql
|
381
|
+
expect(user).to eql user.__getobj__
|
371
382
|
expect(user).to be_a NilClass
|
372
383
|
end
|
373
384
|
|
374
|
-
|
375
|
-
Acfs.add_callback
|
385
|
+
user = model.find_by age: 24, &proc1
|
386
|
+
Acfs.add_callback user, &proc2
|
376
387
|
Acfs.run
|
377
388
|
end
|
378
389
|
end
|
@@ -381,12 +392,14 @@ describe Acfs::Resource::QueryMethods do
|
|
381
392
|
|
382
393
|
describe '.find_by!' do
|
383
394
|
let(:described_method) { :find_by! }
|
395
|
+
|
384
396
|
it_behaves_like 'find_by'
|
385
397
|
|
386
398
|
context 'standard resource' do
|
399
|
+
subject { Acfs.run && user }
|
400
|
+
|
387
401
|
let(:model) { MyUser }
|
388
402
|
let!(:user) { model.send described_method, age: 24 }
|
389
|
-
subject { Acfs.run && user }
|
390
403
|
|
391
404
|
context 'with empty response' do
|
392
405
|
before do
|
@@ -394,12 +407,12 @@ describe Acfs::Resource::QueryMethods do
|
|
394
407
|
.to_return response []
|
395
408
|
end
|
396
409
|
|
397
|
-
it '
|
410
|
+
it 'raises an ResourceNotFound error' do
|
398
411
|
model.find_by! age: 24
|
399
412
|
expect { Acfs.run }.to raise_error Acfs::ResourceNotFound
|
400
413
|
end
|
401
414
|
|
402
|
-
it '
|
415
|
+
it 'does not invoke callback after model could not be loaded' do
|
403
416
|
block = proc {}
|
404
417
|
|
405
418
|
expect(block).not_to receive(:call)
|
@@ -417,29 +430,29 @@ describe Acfs::Resource::QueryMethods do
|
|
417
430
|
.to_return response([{id: 1, name: 'Anno', age: 1604, born_at: 'Santa Maria'}],
|
418
431
|
headers: {
|
419
432
|
'X-Total-Pages' => '4',
|
420
|
-
'Link' => '<http://users.example.org/users?page=2>; rel="next"'
|
421
|
-
})
|
433
|
+
'Link' => '<http://users.example.org/users?page=2>; rel="next"',
|
434
|
+
},)
|
422
435
|
stub_request(:get, 'http://users.example.org/users?page=2')
|
423
436
|
.to_return response([{id: 2, name: 'Anno', age: 1604, born_at: 'Santa Maria'}],
|
424
437
|
headers: {
|
425
438
|
'X-Total-Pages' => '4',
|
426
|
-
'Link' => '<http://users.example.org/users?page=3>; rel="next"'
|
427
|
-
})
|
439
|
+
'Link' => '<http://users.example.org/users?page=3>; rel="next"',
|
440
|
+
},)
|
428
441
|
stub_request(:get, 'http://users.example.org/users?page=3')
|
429
442
|
.to_return response([{id: 3, name: 'Anno', age: 1604, born_at: 'Santa Maria'}],
|
430
443
|
headers: {
|
431
444
|
'X-Total-Pages' => '4',
|
432
|
-
'Link' => '<http://users.example.org/users?page=4>; rel="next"'
|
433
|
-
})
|
445
|
+
'Link' => '<http://users.example.org/users?page=4>; rel="next"',
|
446
|
+
},)
|
434
447
|
stub_request(:get, 'http://users.example.org/users?page=4')
|
435
448
|
.to_return response([{id: 4, name: 'Anno', age: 1604, born_at: 'Santa Maria'}],
|
436
449
|
headers: {
|
437
450
|
'X-Total-Pages' => '4',
|
438
|
-
'Link' => ''
|
439
|
-
})
|
451
|
+
'Link' => '',
|
452
|
+
},)
|
440
453
|
end
|
441
454
|
|
442
|
-
it '
|
455
|
+
it 'iterates all pages' do
|
443
456
|
index = 0
|
444
457
|
model.each_page do |page|
|
445
458
|
expect(page).to be_a Acfs::Collection
|
@@ -459,29 +472,29 @@ describe Acfs::Resource::QueryMethods do
|
|
459
472
|
.to_return response([{id: 1, name: 'Anno', age: 1604, born_at: 'Santa Maria'}],
|
460
473
|
headers: {
|
461
474
|
'X-Total-Pages' => '4',
|
462
|
-
'Link' => '<http://users.example.org/users?where=fuu&page=2>; rel="next"'
|
463
|
-
})
|
475
|
+
'Link' => '<http://users.example.org/users?where=fuu&page=2>; rel="next"',
|
476
|
+
},)
|
464
477
|
stub_request(:get, 'http://users.example.org/users?where=fuu&page=2')
|
465
478
|
.to_return response([{id: 2, name: 'Anno', age: 1604, born_at: 'Santa Maria'}],
|
466
479
|
headers: {
|
467
480
|
'X-Total-Pages' => '4',
|
468
|
-
'Link' => '<http://users.example.org/users?page=3>; rel="next"'
|
469
|
-
})
|
481
|
+
'Link' => '<http://users.example.org/users?page=3>; rel="next"',
|
482
|
+
},)
|
470
483
|
stub_request(:get, 'http://users.example.org/users?page=3')
|
471
484
|
.to_return response([{id: 3, name: 'Anno', age: 1604, born_at: 'Santa Maria'}],
|
472
485
|
headers: {
|
473
486
|
'X-Total-Pages' => '4',
|
474
|
-
'Link' => '<http://users.example.org/users?page=4>; rel="next"'
|
475
|
-
})
|
487
|
+
'Link' => '<http://users.example.org/users?page=4>; rel="next"',
|
488
|
+
},)
|
476
489
|
stub_request(:get, 'http://users.example.org/users?page=4')
|
477
490
|
.to_return response([{id: 4, name: 'Anno', age: 1604, born_at: 'Santa Maria'}],
|
478
491
|
headers: {
|
479
492
|
'X-Total-Pages' => '4',
|
480
|
-
'Link' => ''
|
481
|
-
})
|
493
|
+
'Link' => '',
|
494
|
+
},)
|
482
495
|
end
|
483
496
|
|
484
|
-
it '
|
497
|
+
it 'calls first page with params and follow relations' do
|
485
498
|
index = 0
|
486
499
|
model.each_page(param: 'bla') do |page|
|
487
500
|
expect(page).to be_a Acfs::Collection
|
@@ -500,32 +513,52 @@ describe Acfs::Resource::QueryMethods do
|
|
500
513
|
context 'without parameters' do
|
501
514
|
before do
|
502
515
|
stub_request(:get, 'http://users.example.org/users')
|
503
|
-
.to_return response(
|
516
|
+
.to_return response(
|
517
|
+
[
|
518
|
+
{id: 1, name: 'Anno', age: 1604, born_at: 'Santa Maria'},
|
519
|
+
],
|
504
520
|
headers: {
|
505
521
|
'X-Total-Pages' => '4',
|
506
|
-
'Link' => '<http://users.example.org/users?page=2>; rel="next"'
|
507
|
-
}
|
522
|
+
'Link' => '<http://users.example.org/users?page=2>; rel="next"',
|
523
|
+
},
|
524
|
+
)
|
525
|
+
|
508
526
|
stub_request(:get, 'http://users.example.org/users?page=2')
|
509
|
-
.to_return response(
|
527
|
+
.to_return response(
|
528
|
+
[
|
529
|
+
{id: 2, name: 'Anno', age: 1604, born_at: 'Santa Maria'},
|
530
|
+
],
|
510
531
|
headers: {
|
511
532
|
'X-Total-Pages' => '4',
|
512
|
-
'Link' => '<http://users.example.org/users?page=3>; rel="next"'
|
513
|
-
}
|
533
|
+
'Link' => '<http://users.example.org/users?page=3>; rel="next"',
|
534
|
+
},
|
535
|
+
)
|
536
|
+
|
514
537
|
stub_request(:get, 'http://users.example.org/users?page=3')
|
515
|
-
.to_return response(
|
538
|
+
.to_return response(
|
539
|
+
[
|
540
|
+
{id: 3, name: 'Anno', age: 1604, born_at: 'Santa Maria'},
|
541
|
+
{id: 4, name: 'Anno', age: 1604, born_at: 'Santa Maria'},
|
542
|
+
],
|
516
543
|
headers: {
|
517
544
|
'X-Total-Pages' => '4',
|
518
|
-
'Link' => '<http://users.example.org/users?page=4>; rel="next"'
|
519
|
-
}
|
545
|
+
'Link' => '<http://users.example.org/users?page=4>; rel="next"',
|
546
|
+
},
|
547
|
+
)
|
548
|
+
|
520
549
|
stub_request(:get, 'http://users.example.org/users?page=4')
|
521
|
-
.to_return response(
|
550
|
+
.to_return response(
|
551
|
+
[
|
552
|
+
{id: 5, name: 'Anno', age: 1604, born_at: 'Santa Maria'},
|
553
|
+
],
|
522
554
|
headers: {
|
523
555
|
'X-Total-Pages' => '4',
|
524
|
-
'Link' => ''
|
525
|
-
}
|
556
|
+
'Link' => '',
|
557
|
+
},
|
558
|
+
)
|
526
559
|
end
|
527
560
|
|
528
|
-
it '
|
561
|
+
it 'iterates all pages' do
|
529
562
|
indices = []
|
530
563
|
model.each_item do |item|
|
531
564
|
expect(item).to be_a MyUser
|
@@ -536,7 +569,7 @@ describe Acfs::Resource::QueryMethods do
|
|
536
569
|
expect(indices).to eq [1, 2, 3, 4, 5]
|
537
570
|
end
|
538
571
|
|
539
|
-
it '
|
572
|
+
it 'passes the collection to the provided block' do
|
540
573
|
model.each_item do |_item, collection|
|
541
574
|
expect(collection).to be_a Acfs::Collection
|
542
575
|
end
|