spec/readable_spec.rb in unread-0.4.0 vs spec/readable_spec.rb in unread-0.5.0

- old
+ new

@@ -130,9 +130,17 @@ expect(@email1.unread?(@reader)).to be_falsey expect(@email2.unread?(@reader)).to be_falsey end + it "should perform less queries if the objects are already read" do + Email.mark_as_read! :all, :for => @reader + + expect { + Email.mark_as_read! [ @email1, @email2 ], :for => @reader + }.to perform_queries(1) + end + it "should mark all objects as read" do Email.mark_as_read! :all, :for => @reader expect(@reader.read_mark_global(Email).timestamp).to eq Time.current expect(@reader.read_marks.single).to eq []