Skip to content

Instantly share code, notes, and snippets.

@chrislerum
Created June 20, 2016 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrislerum/e37d40d430434a994530284e56337067 to your computer and use it in GitHub Desktop.
Save chrislerum/e37d40d430434a994530284e56337067 to your computer and use it in GitHub Desktop.
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