mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 00:37:44 +08:00
DEV: Allow fab! without block (#24314)
The most common thing that we do with fab! is: fab!(:thing) { Fabricate(:thing) } This commit adds a shorthand for this which is just simply: fab!(:thing) i.e. If you omit the block, then, by default, you'll get a `Fabricate`d object using the fabricator of the same name.
This commit is contained in:

committed by
GitHub

parent
d91456fd53
commit
6e161d3e75
@ -281,7 +281,7 @@ RSpec.describe Email::Receiver do
|
||||
|
||||
describe "reply" do
|
||||
let(:reply_key) { "4f97315cc828096c9cb34c6f1a0d6fe8" }
|
||||
fab!(:category) { Fabricate(:category) }
|
||||
fab!(:category)
|
||||
fab!(:user) { Fabricate(:user, email: "discourse@bar.com") }
|
||||
fab!(:topic) { create_topic(category: category, user: user) }
|
||||
fab!(:post) { create_post(topic: topic) }
|
||||
@ -1913,7 +1913,7 @@ RSpec.describe Email::Receiver do
|
||||
|
||||
context "when email is a reply" do
|
||||
let(:reply_key) { "4f97315cc828096c9cb34c6f1a0d6fe8" }
|
||||
fab!(:category) { Fabricate(:category) }
|
||||
fab!(:category)
|
||||
fab!(:user) { Fabricate(:user, email: "discourse@bar.com") }
|
||||
fab!(:user2) { Fabricate(:user, email: "someone_else@bar.com") }
|
||||
fab!(:topic) { create_topic(category: category, user: user) }
|
||||
@ -2221,7 +2221,7 @@ RSpec.describe Email::Receiver do
|
||||
end
|
||||
|
||||
describe "replying to digest" do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:user)
|
||||
fab!(:digest_message_id) { "7402d8ae-1c6e-44bc-9948-48e007839bcc@localhost" }
|
||||
fab!(:email_log) do
|
||||
Fabricate(
|
||||
|
Reference in New Issue
Block a user