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:
Régis Hanol 2014-03-11 12:40:55 +01:00
commit 80911b92d0
1 changed files with 8 additions and 0 deletions

View File

@ -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