mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 04:01:29 -05:00
Merge pull request #2109 from vikhyat/poll-plugin
Add a test to make sure the poll prefix translation can be a regex
This commit is contained in:
commit
80911b92d0
1 changed files with 8 additions and 0 deletions
|
@ -14,6 +14,14 @@ describe PollPlugin::Poll do
|
|||
expect(poll.is_poll?).to be_false
|
||||
end
|
||||
|
||||
it "allows the prefix translation to contain regular expressions" do
|
||||
topic.title = "Poll : This might be a poll"
|
||||
topic.save
|
||||
expect(PollPlugin::Poll.new(post).is_poll?).to be_false
|
||||
I18n.expects(:t).with('poll.prefix').returns("Poll\\s?:")
|
||||
expect(PollPlugin::Poll.new(post).is_poll?).to be_true
|
||||
end
|
||||
|
||||
it "should get options correctly" do
|
||||
expect(poll.options).to eq(["Chitoge", "Onodera"])
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue