2017-01-27 13:42:39 -05:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe "Post rake tasks" do
|
|
|
|
before do
|
|
|
|
Discourse::Application.load_tasks
|
2017-01-28 00:34:47 -05:00
|
|
|
IO.any_instance.stubs(:puts)
|
2017-01-27 13:42:39 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'remap' do
|
|
|
|
it 'should remap posts' do
|
|
|
|
post = Fabricate(:post, raw: "The quick brown fox jumps over the lazy dog")
|
|
|
|
|
|
|
|
Rake::Task['posts:remap'].invoke("brown","red")
|
|
|
|
post.reload
|
|
|
|
expect(post.raw).to eq('The quick red fox jumps over the lazy dog')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|