mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
Add a test to make sure the poll prefix translation can be a regex.
This commit is contained in:
parent
9f2b48014c
commit
0950dde8d0
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