correct specs so they run on latest

This commit is contained in:
Sam 2017-07-18 15:45:23 -04:00
parent b7f58fe880
commit 14c2439473
3 changed files with 6 additions and 6 deletions
plugins/discourse-narrative-bot/spec/discourse_narrative_bot

@ -348,7 +348,7 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
describe 'when reply contains the skip trigger' do describe 'when reply contains the skip trigger' do
it 'should create the right reply' do it 'should create the right reply' do
parent_category = Fabricate(:category, name: 'a') 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) post.update!(raw: skip_trigger)
described_class.any_instance.expects(:enqueue_timeout_job).with(user) 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 describe 'when user recovers a post in the right topic' do
it 'should create the right reply' do it 'should create the right reply' do
parent_category = Fabricate(:category, name: 'a') 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 post
PostDestroyer.new(user, post).destroy PostDestroyer.new(user, post).destroy
@ -652,7 +652,7 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
end end
it 'should create the right reply' do 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) narrative.input(:reply, user, post: post)
expect(Post.offset(1).last.raw).to eq(I18n.t( 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 it 'should create the right reply' do
post.update!( 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) 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 describe 'when roll dice command is present inside a quote' do
it 'should ignore the command' do it 'should ignore the command' do
user 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 } expect { described_class.new(:reply, user, post_id: post.id).select }
.to_not change { Post.count } .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 describe 'when quote command is present inside a onebox or quote' do
it 'should ignore the command' do it 'should ignore the command' do
user 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 } expect { described_class.new(:reply, user, post_id: post.id).select }
.to_not change { Post.count } .to_not change { Post.count }