spec/serializable/paging_spec.rb in restpack_serializer-0.4.9 vs spec/serializable/paging_spec.rb in restpack_serializer-0.4.10

- old
+ new

@@ -99,11 +99,11 @@ context "when sideloading" do let(:params) { { include: 'albums' } } it "includes side-loaded models" do - page[:albums].should_not == nil + page[:linked][:albums].should_not == nil end it "includes the side-loads in the main meta data" do page[:meta][:songs][:include].should == [:albums] end @@ -116,21 +116,21 @@ song = page[:songs].first song_model = MyApp::Song.find(song[:id]) song[:links][:album].should == song_model.album_id.to_s song[:links][:artist].should == song_model.artist_id.to_s - album = page[:albums].first + album = page[:linked][:albums].first album_model = MyApp::Album.find(album[:id]) album[:links][:artist].should == album_model.artist_id.to_s album[:links][:songs].should == page[:songs].map { |song| song[:id] } end context "with includes as comma delimited string" do let(:params) { { include: "albums,artists" } } it "includes side-loaded models" do - page[:albums].should_not == nil - page[:artists].should_not == nil + page[:linked][:albums].should_not == nil + page[:linked][:artists].should_not == nil end it "includes the side-loads in page hrefs" do page[:meta][:songs][:next_href].should == '/songs?page=2&include=albums,artists' end