Sha256: bcc35c7e1703955d04fe660433cbfed4be246eec60c41f4ef7db1bb781c48400
Contents?: true
Size: 636 Bytes
Versions: 2
Compression:
Stored size: 636 Bytes
Contents
require 'spec_helper' describe Likeable::Like do before do @time = Time.now end describe 'attributes' do it 'stores target, user, and created_at' do like = Likeable::Like.new(:target => @target, :user => @user, :time => @time) like.user.should eq(@user) like.target.should eq(@target) # Times often fail equality checks due to microsec precision like.created_at.should be_within(1).of(@time) end it 'converts float time to propper Time object' do like = Likeable::Like.new(:time => @time.to_f) like.created_at.should be_within(1).of(@time) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
likeable-0.1.1 | spec/likeable/like_spec.rb |
likeable-0.1.0 | spec/likeable/like_spec.rb |