about summary refs log tree commit diff
path: root/spec/fabricators
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-01-24 17:28:22 +0100
committerGitHub <noreply@github.com>2020-01-24 17:28:22 +0100
commit0be67df4f0a64367d9e376b06bd3fd2fb9ca8195 (patch)
tree2eaa85c899033aab9bd1b2f9da2d727ce5788e16 /spec/fabricators
parenta8c109baca4d02cc8aed454e231518c1f8ec1844 (diff)
parentbdc1581556b86ba25a385c9309db714eeaba1ca1 (diff)
Merge pull request #1265 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/fabricators')
-rw-r--r--spec/fabricators/announcement_fabricator.rb6
-rw-r--r--spec/fabricators/announcement_mute_fabricator.rb4
-rw-r--r--spec/fabricators/announcement_reaction_fabricator.rb5
-rw-r--r--spec/fabricators/media_attachment_fabricator.rb18
4 files changed, 22 insertions, 11 deletions
diff --git a/spec/fabricators/announcement_fabricator.rb b/spec/fabricators/announcement_fabricator.rb
new file mode 100644
index 000000000..5a3871d90
--- /dev/null
+++ b/spec/fabricators/announcement_fabricator.rb
@@ -0,0 +1,6 @@
+Fabricator(:announcement) do
+  text      { Faker::Lorem.paragraph(sentence_count: 2) }
+  published true
+  starts_at nil
+  ends_at   nil
+end
diff --git a/spec/fabricators/announcement_mute_fabricator.rb b/spec/fabricators/announcement_mute_fabricator.rb
new file mode 100644
index 000000000..c4eafe8f4
--- /dev/null
+++ b/spec/fabricators/announcement_mute_fabricator.rb
@@ -0,0 +1,4 @@
+Fabricator(:announcement_mute) do
+  account
+  announcement
+end
diff --git a/spec/fabricators/announcement_reaction_fabricator.rb b/spec/fabricators/announcement_reaction_fabricator.rb
new file mode 100644
index 000000000..f923c59c6
--- /dev/null
+++ b/spec/fabricators/announcement_reaction_fabricator.rb
@@ -0,0 +1,5 @@
+Fabricator(:announcement_reaction) do
+  account
+  announcement
+  name '🌿'
+end
diff --git a/spec/fabricators/media_attachment_fabricator.rb b/spec/fabricators/media_attachment_fabricator.rb
index bb938e36d..651927c2d 100644
--- a/spec/fabricators/media_attachment_fabricator.rb
+++ b/spec/fabricators/media_attachment_fabricator.rb
@@ -1,16 +1,12 @@
 Fabricator(:media_attachment) do
   account
+
   file do |attrs|
-    [
-      case attrs[:type]
-      when :gifv
-        attachment_fixture ['attachment.gif', 'attachment.webm'].sample
-      when :image
-        attachment_fixture 'attachment.jpg'
-      when nil
-        attachment_fixture ['attachment.gif', 'attachment.jpg', 'attachment.webm'].sample
-      end,
-      nil
-    ].sample
+    case attrs[:type]
+    when :gifv, :video
+      attachment_fixture('attachment.webm')
+    else
+      attachment_fixture('attachment.jpg')
+    end
   end
 end