mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 18:13:39 +08:00
spec for posts:remap rake task
This commit is contained in:
parent
e3670c52fa
commit
c36dda70ae
17
spec/tasks/posts_spec.rb
Normal file
17
spec/tasks/posts_spec.rb
Normal file
|
@ -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
Block a user