about summary refs log tree commit diff
path: root/spec/models/mention_spec.rb
diff options
context:
space:
mode:
authorSamy KACIMI <samy.kacimi@gmail.com>2017-04-05 00:29:56 +0200
committerSamy KACIMI <samy.kacimi@gmail.com>2017-04-05 00:29:56 +0200
commit81c76fe375d9342e5a436db05c8e25305c650e8d (patch)
tree9d81c36f8745de3d5ab8827a82a14be369f0d23e /spec/models/mention_spec.rb
parent6fd865c0004efbf11ee87c06fea9f48af567fabe (diff)
add more tests to models
Diffstat (limited to 'spec/models/mention_spec.rb')
-rw-r--r--spec/models/mention_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/mention_spec.rb b/spec/models/mention_spec.rb
index 5c91fda02..dbcf6a32c 100644
--- a/spec/models/mention_spec.rb
+++ b/spec/models/mention_spec.rb
@@ -1,5 +1,22 @@
 require 'rails_helper'
 
 RSpec.describe Mention, type: :model do
+  describe 'validations' do
+    it 'has a valid fabricator' do
+      mention = Fabricate.build(:mention)
+      expect(mention).to be_valid
+    end
 
+    it 'is invalid without an account' do
+      mention = Fabricate.build(:mention, account: nil)
+      mention.valid?
+      expect(mention).to model_have_error_on_field(:account)
+    end
+
+    it 'is invalid without a status' do
+      mention = Fabricate.build(:mention, status: nil)
+      mention.valid?
+      expect(mention).to model_have_error_on_field(:status)
+    end
+  end
 end