mirror of
https://github.com/discourse/discourse.git
synced 2025-03-22 16:45:32 +08:00
correct specs so they run on latest
This commit is contained in:
parent
b7f58fe880
commit
14c2439473
@ -348,7 +348,7 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
|
||||
describe 'when reply contains the skip trigger' do
|
||||
it 'should create the right reply' do
|
||||
parent_category = Fabricate(:category, name: 'a')
|
||||
category = Fabricate(:category, parent_category: parent_category, name: 'b')
|
||||
_category = Fabricate(:category, parent_category: parent_category, name: 'b')
|
||||
|
||||
post.update!(raw: skip_trigger)
|
||||
described_class.any_instance.expects(:enqueue_timeout_job).with(user)
|
||||
@ -382,7 +382,7 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
|
||||
describe 'when user recovers a post in the right topic' do
|
||||
it 'should create the right reply' do
|
||||
parent_category = Fabricate(:category, name: 'a')
|
||||
category = Fabricate(:category, parent_category: parent_category, name: 'b')
|
||||
_category = Fabricate(:category, parent_category: parent_category, name: 'b')
|
||||
post
|
||||
|
||||
PostDestroyer.new(user, post).destroy
|
||||
@ -652,7 +652,7 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
|
||||
end
|
||||
|
||||
it 'should create the right reply' do
|
||||
post.update!(raw: "[details=\"This is a test\"]wooohoo[/details]")
|
||||
post.update!(raw: "[details=\"This is a test\"]\nwooohoo\n[/details]")
|
||||
narrative.input(:reply, user, post: post)
|
||||
|
||||
expect(Post.offset(1).last.raw).to eq(I18n.t(
|
||||
|
@ -612,7 +612,7 @@ describe DiscourseNarrativeBot::NewUserNarrative do
|
||||
|
||||
it 'should create the right reply' do
|
||||
post.update!(
|
||||
raw: '[quote="#{post.user}, post:#{post.post_number}, topic:#{topic.id}"]\n:monkey: :fries:\n[/quote]'
|
||||
raw: "[quote=\"#{post.user}, post:#{post.post_number}, topic:#{topic.id}\"]\n:monkey: :fries:\n[/quote]"
|
||||
)
|
||||
|
||||
narrative.expects(:enqueue_timeout_job).with(user)
|
||||
|
@ -562,7 +562,7 @@ describe DiscourseNarrativeBot::TrackSelector do
|
||||
describe 'when roll dice command is present inside a quote' do
|
||||
it 'should ignore the command' do
|
||||
user
|
||||
post.update!(raw: '[quote="Donkey, post:6, topic:1"]@discobot roll 2d1[/quote]')
|
||||
post.update!(raw: "[quote=\"Donkey, post:6, topic:1\"]\n@discobot roll 2d1\n[/quote]")
|
||||
|
||||
expect { described_class.new(:reply, user, post_id: post.id).select }
|
||||
.to_not change { Post.count }
|
||||
@ -599,7 +599,7 @@ describe DiscourseNarrativeBot::TrackSelector do
|
||||
describe 'when quote command is present inside a onebox or quote' do
|
||||
it 'should ignore the command' do
|
||||
user
|
||||
post.update!(raw: '[quote="Donkey, post:6, topic:1"]@discobot quote[/quote]')
|
||||
post.update!(raw: "[quote=\"Donkey, post:6, topic:1\"]\n@discobot quote\n[/quote]")
|
||||
|
||||
expect { described_class.new(:reply, user, post_id: post.id).select }
|
||||
.to_not change { Post.count }
|
||||
|
Loading…
x
Reference in New Issue
Block a user