about summary refs log tree commit diff
path: root/spec/models
diff options
context:
space:
mode:
authorunarist <m.unarist@gmail.com>2017-09-17 22:21:57 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-09-17 15:21:57 +0200
commitdd6f9a1b827226346d0fff22a79538351fb33028 (patch)
tree0d9f897f78480fea05b6cf626d855767e45c0397 /spec/models
parent3f07f1b2b18affd0c48f3673d124cfbea6b9e380 (diff)
Validate uri presence for remote status (#4985)
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/status_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/status_spec.rb b/spec/models/status_spec.rb
index f7ee0a609..12efcae61 100644
--- a/spec/models/status_spec.rb
+++ b/spec/models/status_spec.rb
@@ -516,6 +516,14 @@ RSpec.describe Status, type: :model do
     end
   end
 
+  describe 'validation' do
+    it 'disallow empty uri for remote status' do
+      alice.update(domain: 'example.com')
+      status = Fabricate.build(:status, uri: '', account: alice)
+      expect(status).to model_have_error_on_field(:uri)
+    end
+  end
+
   describe 'after_create' do
     it 'saves ActivityPub uri as uri for local status' do
       status = Status.create(account: alice, text: 'foo')