spec/post_spec.rb in mongoid_rating-0.1.1 vs spec/post_spec.rb in mongoid_rating-0.1.2

- old
+ new

@@ -50,9 +50,19 @@ context "when rate_value not in rating range" do it { expect { @post.rate 17, @sally }.to raise_error() } it { expect { @post.rate -17, @sally }.to raise_error() } end + + it 'allows string rate' do + @post.rate! '5', @bob + @post.rate.should eql 5.0 + end + + it 'allows string rate' do + @post.rate! '3.2', @bob + @post.rate.should eql 3.2 + end end describe "#rated?" do describe "for Bob" do specify { @post.rate_by?(@bob).should be_true }