mirror of
https://github.com/discourse/discourse.git
synced 2025-06-21 20:21:54 +08:00

Same as #31576, but in that one I added some support files that turned out to be unnecessary and broke the build. So this is the re-do. 🙏
17 lines
412 B
Ruby
17 lines
412 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe "destroy:posts" do
|
|
it "accepts a list of post IDs piped through STDIN" do
|
|
destroy_task = instance_spy(DestroyTask)
|
|
DestroyTask.stubs(:new).returns(destroy_task)
|
|
|
|
STDIN.stubs(:read).returns("1,2,3\n")
|
|
|
|
capture_stdout do
|
|
invoke_rake_task("destroy:posts")
|
|
|
|
expect(destroy_task).to have_received(:destroy_posts).with(%w[1 2 3])
|
|
end
|
|
end
|
|
end
|