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:
Christian Bruckmayer 2016-03-10 13:59:59 +01:00
parent 55ab8a8e8f
commit a6c89351c5
2 changed files with 15 additions and 1 deletions

View 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