spec for posts:remap rake task
This commit is contained in:
parent
e3670c52fa
commit
c36dda70ae
|
@ -0,0 +1,17 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe "Post rake tasks" do
|
||||||
|
before do
|
||||||
|
Discourse::Application.load_tasks
|
||||||
|
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
|
Loading…
Reference in New Issue