mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
fix: undefined variable in post:rebake_match
This commit is contained in:
@@ -3,6 +3,9 @@ require 'highline/import'
|
||||
require 'highline/simulate'
|
||||
|
||||
RSpec.describe "Post rake tasks" do
|
||||
let!(:post) { Fabricate(:post, raw: 'The quick brown fox jumps over the lazy dog') }
|
||||
let!(:tricky_post) { Fabricate(:post, raw: 'Today ^Today') }
|
||||
|
||||
before do
|
||||
Rake::Task.clear
|
||||
Discourse::Application.load_tasks
|
||||
@@ -10,11 +13,7 @@ RSpec.describe "Post rake tasks" do
|
||||
end
|
||||
|
||||
describe 'remap' do
|
||||
let!(:tricky_post) { Fabricate(:post, raw: 'Today ^Today') }
|
||||
|
||||
it 'should remap posts' do
|
||||
post = Fabricate(:post, raw: "The quick brown fox jumps over the lazy dog")
|
||||
|
||||
HighLine::Simulate.with('y') do
|
||||
Rake::Task['posts:remap'].invoke("brown", "red")
|
||||
end
|
||||
@@ -43,4 +42,16 @@ RSpec.describe "Post rake tasks" do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'rebake_match' do
|
||||
it 'rebakes matched posts' do
|
||||
post.update_attributes(cooked: '')
|
||||
|
||||
HighLine::Simulate.with('y') do
|
||||
Rake::Task['posts:rebake_match'].invoke('brown')
|
||||
end
|
||||
|
||||
expect(post.reload.cooked).to eq('<p>The quick brown fox jumps over the lazy dog</p>')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user