FIX: Allow users to create polls in PMs with non human users (#9055)

This commit is contained in:
Dan Ungureanu
2020-03-02 21:29:40 +02:00
committed by GitHub
parent a653737a66
commit c62d5b139b
3 changed files with 31 additions and 1 deletions

View File

@ -606,6 +606,19 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
)
end
it 'allows new users to create polls' do
user.update(trust_level: 0)
post = PostCreator.create(user, topic_id: topic.id, raw: <<~RAW)
[poll type=regular]
* foo
* bar
[/poll]
RAW
expect(post.errors[:base].size).to eq(0)
end
describe 'when post is not in the right topic' do
it 'should not do anything' do
other_post