mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-27 02:16:20 +08:00
28 lines
855 B
Ruby
28 lines
855 B
Ruby
require 'test_helper'
|
|
|
|
class NotificationTest < ActiveSupport::TestCase
|
|
def setup
|
|
@user = users(:john)
|
|
@notification = notificaton(:one)
|
|
@user_notification = UserNotification.new(user: @user,
|
|
notificaton: @notificaton)
|
|
end
|
|
|
|
should have_db_column(:title).of_type(:string)
|
|
should have_db_column(:message).of_type(:string)
|
|
should have_db_column(:type_of).of_type(:integer)
|
|
should have_db_column(:created_at).of_type(:datetime)
|
|
should have_db_column(:updated_at).of_type(:datetime)
|
|
should have_db_column(:generator_user_id)
|
|
|
|
should have_many(:user_notifications)
|
|
should have_many(:users)
|
|
should belong_to(:generator_user).class_name('User')
|
|
|
|
test '#already_seen' do
|
|
notifications = Notification.already_seen(@user)
|
|
byebug
|
|
assert notifications.eq([false])
|
|
end
|
|
end
|