spec/unit/api/query_builder_spec.rb in npr-1.2.0 vs spec/unit/api/query_builder_spec.rb in npr-2.0.0

- old
+ new

@@ -10,11 +10,11 @@ @builder.where(:id => 5).order("date descending").limit(10).offset(100) @builder.to_params.should eq Hash[ :id => 5 , :sort => "date descending", :numResults => 10, - :startNum => 100 + :startNum => 101 ] end it "merges in @builder[:extra] last, which overrides anything" do @builder.set(:id => 5).where(:id => 10) @@ -170,9 +170,14 @@ @builder.builder.should eq Hash[:offset => 100] end it "returns itself" do @builder.offset(0).should eq @builder + end + + it "sets the startNum to value + 1" do + @builder.offset(100) + @builder.to_params[:startNum].should eq 101 end end #----------------------