fix poll plugin specs deprecations

This commit is contained in:
Régis Hanol 2014-09-25 18:11:53 +02:00
parent d37ed80e8a
commit 57f7b92bb4
1 changed files with 5 additions and 5 deletions

View File

@ -7,20 +7,20 @@ describe PollPlugin::Poll do
let(:user) { Fabricate(:user) }
it "should detect poll post correctly" do
expect(poll.is_poll?).should == true
expect(poll.is_poll?).to be_truthy
post2 = create_post(topic: topic, raw: "This is a generic reply.")
expect(PollPlugin::Poll.new(post2).is_poll?).should == false
expect(PollPlugin::Poll.new(post2).is_poll?).to be_falsey
post.topic.title = "Not a poll"
expect(poll.is_poll?).should == false
expect(poll.is_poll?).to be_falsey
end
it "strips whitespace from the prefix translation" do
topic.title = "Polll: This might be a poll"
topic.save
expect(PollPlugin::Poll.new(post).is_poll?).should == false
expect(PollPlugin::Poll.new(post).is_poll?).to be_falsey
I18n.expects(:t).with('poll.prefix').returns("Polll ")
I18n.expects(:t).with('poll.closed_prefix').returns("Closed Poll ")
expect(PollPlugin::Poll.new(post).is_poll?).should == true
expect(PollPlugin::Poll.new(post).is_poll?).to be_truthy
end
it "should get options correctly" do