Closed ghost closed 8 years ago
The json_response from the newer version of ActiveModelSerializer is
expected [{:id=>2184, :title=>"GPS Receiver", :price=>"48.2190411765297", :published=>false, :user=>{:id=>3520, :email=>"frankie@dare.co.uk", :auth_token=>"aqDpo9eRQd18CgVZJhNu"}}, {:id=>2185, :title=>"Gel Compressor", :price=>"46.5630253827439", :published=>false, :user=>{:id=>3521, :email=>"zita@kuhlman.biz", :auth_token=>"_AT51pnv4iTQ5M6UkYhp"}}, {:id=>2186, :title=>"Output Side Amplifier", :price=>"38.7696783474247", :published=>false, :user=>{:id=>3522, :email=>"madisen.quitzon@becker.ca", :auth_token=>"rx6F6hei_tHNCE6LNpzV"}}, {:id=>2187, :title=>"Tag Component", :price=>"117.246549157407", :published=>false, :user=>{:id=>3523, :email=>"maybell_dibbert@ruecker.ca", :auth_token=>"GD-W7Pnje6JjEdsoMvF-"}}] to respond tohas_key?``
expected [{:id=>2184, :title=>"GPS Receiver", :price=>"48.2190411765297", :published=>false, :user=>{:id=>3520, :email=>"frankie@dare.co.uk", :auth_token=>"aqDpo9eRQd18CgVZJhNu"}}, {:id=>2185, :title=>"Gel Compressor", :price=>"46.5630253827439", :published=>false, :user=>{:id=>3521, :email=>"zita@kuhlman.biz", :auth_token=>"_AT51pnv4iTQ5M6UkYhp"}}, {:id=>2186, :title=>"Output Side Amplifier", :price=>"38.7696783474247", :published=>false, :user=>{:id=>3522, :email=>"madisen.quitzon@becker.ca", :auth_token=>"rx6F6hei_tHNCE6LNpzV"}}, {:id=>2187, :title=>"Tag Component", :price=>"117.246549157407", :published=>false, :user=>{:id=>3523, :email=>"maybell_dibbert@ruecker.ca", :auth_token=>"GD-W7Pnje6JjEdsoMvF-"}}] to respond to
The meta object is not included. Just an array of products even without [:products] key.
Maybe I need to learn http://jsonapi.org/ first and come back to this tutorial to conform to the new standards.
Can anybody give a hint on how to make these tests pass under the new gem or implement http://jsonapi.org/format/#fetching-pagination ?
Thank you!
If you are using version 0.10.X of active model serializers I recommend you change the adapter to json, something like:
0.10.X
json
https://github.com/IcaliaLabs/pager-api#a-note-on-active-model-serializers-010
The json_response from the newer version of ActiveModelSerializer is
expected [{:id=>2184, :title=>"GPS Receiver", :price=>"48.2190411765297", :published=>false, :user=>{:id=>3520, :email=>"frankie@dare.co.uk", :auth_token=>"aqDpo9eRQd18CgVZJhNu"}}, {:id=>2185, :title=>"Gel Compressor", :price=>"46.5630253827439", :published=>false, :user=>{:id=>3521, :email=>"zita@kuhlman.biz", :auth_token=>"_AT51pnv4iTQ5M6UkYhp"}}, {:id=>2186, :title=>"Output Side Amplifier", :price=>"38.7696783474247", :published=>false, :user=>{:id=>3522, :email=>"madisen.quitzon@becker.ca", :auth_token=>"rx6F6hei_tHNCE6LNpzV"}}, {:id=>2187, :title=>"Tag Component", :price=>"117.246549157407", :published=>false, :user=>{:id=>3523, :email=>"maybell_dibbert@ruecker.ca", :auth_token=>"GD-W7Pnje6JjEdsoMvF-"}}] to respond to
has_key?``The meta object is not included. Just an array of products even without [:products] key.
Maybe I need to learn http://jsonapi.org/ first and come back to this tutorial to conform to the new standards.
Can anybody give a hint on how to make these tests pass under the new gem or implement http://jsonapi.org/format/#fetching-pagination ?
Thank you!