discourse/spec/models/email_log_spec.rb

25 lines
489 B
Ruby
Raw Normal View History

2013-02-06 03:16:51 +08:00
require 'spec_helper'
describe EmailLog do
2013-02-26 00:42:20 +08:00
2013-02-06 03:16:51 +08:00
it { should belong_to :user }
it { should validate_presence_of :to_address }
it { should validate_presence_of :email_type }
context 'after_create with user' do
let(:user) { Fabricate(:user) }
it 'updates the last_emailed_at value for the user' do
lambda {
user.email_logs.create(email_type: 'blah', to_address: user.email)
user.reload
}.should change(user, :last_emailed_at)
end
end
end