spec/readable_spec.rb in unread-0.6.1 vs spec/readable_spec.rb in unread-0.6.2
- old
+ new
@@ -23,9 +23,14 @@
expect(Email.unread_by(@reader).count).to eq 1
expect(Email.unread_by(@other_reader)).to eq [@email1, @email2]
end
+ it "should return empty array directly after marking all as read" do
+ Email.mark_as_read! :all, :for => @reader
+ expect(Email.unread_by(@reader)).to eq([])
+ end
+
it "should not allow invalid parameter" do
[ 42, nil, 'foo', :foo, {} ].each do |not_a_reader|
expect {
Email.unread_by(not_a_reader)
}.to raise_error(ArgumentError)