Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
rspec ./spec/models/video_spec.rb
.....F
Failures:
1) Video#last_used works with one video
Failure/Error: expect(Video.last_used.usec).to eq video.updated_at.usec
expected: 840199
got: 0
(compared using ==)
# ./spec/models/video_spec.rb:52:in `block (3 levels) in <top (required)>'
Finished in 1.91 seconds (files took 4.36 seconds to load)
6 examples, 1 failure
Failed examples:
rspec ./spec/models/video_spec.rb:50 # Video#last_used works with one video
# get updated_at for most recently updated video
42 def self.last_used
43 Video.order(:updated_at).last.updated_at
44 end
3 describe Video do
.
.
.
49 context "#last_used" do
50 it "works with one video" do
51 video = create(:video)
52 expect(Video.last_used.usec).to eq video.updated_at.usec
53 end
54 end
55 end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment