Skip to content

A platform for community discussion. Free, open, simple.

DEV: minimum fabricators for post/topic (#26671)

Joffrey JAFFEUX09311c7dab5e
diff --git a/app/assets/javascripts/discourse/app/lib/fabricators.js b/app/assets/javascripts/discourse/app/lib/fabricators.js
index f9c077291b7..557f65ee650 100644
--- a/app/assets/javascripts/discourse/app/lib/fabricators.js
+++ b/app/assets/javascripts/discourse/app/lib/fabricators.js
@@ -29,6 +29,20 @@ export default class CoreFabricators {
setOwner(this, owner);
}
+ post(args = {}) {
+ return this.store.createRecord("post", {
+ id: args.id || incrementSequence(),
+ topic: args.topic || this.topic(),
+ });
+ }
+
+ topic(args = {}) {
+ return this.store.createRecord("topic", {
+ id: args.id || incrementSequence(),
+ title: args.title || getLoadedFaker().faker.commerce.productName(),
+ });
+ }
+
category(args = {}) {
const name = args.name || getLoadedFaker().faker.commerce.product();