FIX: Track should only continue if user is alone with bot in a PM.

This commit is contained in:
Guo Xiang Tan
2017-06-06 09:46:28 +09:00
parent ba578f2aa9
commit c1dc6f6cd7
2 changed files with 21 additions and 8 deletions

View File

@ -188,6 +188,19 @@ describe DiscourseNarrativeBot::TrackSelector do
end
end
end
context 'when a new user is added into the topic' do
before do
topic.allowed_users << Fabricate(:user)
end
it 'should stop the new user track' do
post
expect { described_class.new(:reply, user, post_id: post.id).select }
.to_not change { Post.count }
end
end
end
context 'at the end of a tutorial track' do