about summary refs log tree commit diff
path: root/spec/models
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-01-24 14:37:06 +0100
committerThibaut Girka <thib@sitedethib.com>2020-01-24 14:37:06 +0100
commit9adeaf2bfc1c16ca70e611b5288886b21414217b (patch)
tree53372bc9bd6f38d158aad50c768e18773b7d3f3b /spec/models
parenta8c109baca4d02cc8aed454e231518c1f8ec1844 (diff)
parent4bae4e972d43f71bffb888ac82c180b2fa3f1ada (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `app/controllers/statuses_controller.rb`:
  Minor conflict due to theming system
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/announcement_mute_spec.rb4
-rw-r--r--spec/models/announcement_reaction_spec.rb4
-rw-r--r--spec/models/announcement_spec.rb4
-rw-r--r--spec/models/media_attachment_spec.rb13
4 files changed, 17 insertions, 8 deletions
diff --git a/spec/models/announcement_mute_spec.rb b/spec/models/announcement_mute_spec.rb
new file mode 100644
index 000000000..9d0e4c903
--- /dev/null
+++ b/spec/models/announcement_mute_spec.rb
@@ -0,0 +1,4 @@
+require 'rails_helper'
+
+RSpec.describe AnnouncementMute, type: :model do
+end
diff --git a/spec/models/announcement_reaction_spec.rb b/spec/models/announcement_reaction_spec.rb
new file mode 100644
index 000000000..f6e151584
--- /dev/null
+++ b/spec/models/announcement_reaction_spec.rb
@@ -0,0 +1,4 @@
+require 'rails_helper'
+
+RSpec.describe AnnouncementReaction, type: :model do
+end
diff --git a/spec/models/announcement_spec.rb b/spec/models/announcement_spec.rb
new file mode 100644
index 000000000..7f7b647a9
--- /dev/null
+++ b/spec/models/announcement_spec.rb
@@ -0,0 +1,4 @@
+require 'rails_helper'
+
+RSpec.describe Announcement, type: :model do
+end
diff --git a/spec/models/media_attachment_spec.rb b/spec/models/media_attachment_spec.rb
index a275621a1..456bc4216 100644
--- a/spec/models/media_attachment_spec.rb
+++ b/spec/models/media_attachment_spec.rb
@@ -31,14 +31,6 @@ RSpec.describe MediaAttachment, type: :model do
     context 'file is blank' do
       let(:file) { nil }
 
-      context 'remote_url is blank' do
-        let(:remote_url) { '' }
-
-        it 'returns false' do
-          is_expected.to be false
-        end
-      end
-
       context 'remote_url is present' do
         let(:remote_url) { 'remote_url' }
 
@@ -153,6 +145,11 @@ RSpec.describe MediaAttachment, type: :model do
     end
   end
 
+  it 'is invalid without file' do
+    media = MediaAttachment.new(account: Fabricate(:account))
+    expect(media.valid?).to be false
+  end
+
   describe 'descriptions for remote attachments' do
     it 'are cut off at 1500 characters' do
       media = Fabricate(:media_attachment, description: 'foo' * 1000, remote_url: 'http://example.com/blah.jpg')