2016-03-28 07:41:00 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe NotificationSetting, type: :model do
|
|
|
|
describe "Associations" do
|
|
|
|
it { is_expected.to belong_to(:user) }
|
2016-03-28 17:22:28 -04:00
|
|
|
it { is_expected.to belong_to(:source) }
|
2016-03-28 07:41:00 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "Validation" do
|
|
|
|
subject { NotificationSetting.new }
|
|
|
|
|
|
|
|
it { is_expected.to validate_presence_of(:user) }
|
|
|
|
it { is_expected.to validate_presence_of(:source) }
|
|
|
|
it { is_expected.to validate_presence_of(:level) }
|
|
|
|
end
|
|
|
|
end
|