Make Comment find_since_last_login scope robust against nil value
to fix production ArgumentError: bad value for range. Fixes #807.
This commit is contained in:
parent
55ab8a8e8f
commit
a6c89351c5
2 changed files with 15 additions and 1 deletions
10
spec/models/comment_spec.rb
Normal file
10
spec/models/comment_spec.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Commercial do
|
||||
|
||||
describe '.find_since_last_login' do
|
||||
it 'returns none if last_sign_in_at is nil' do
|
||||
expect(Comment.find_since_last_login(create(:user))).to eq(Comment.none)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue