Created
June 20, 2016 16:52
-
-
Save chrislerum/e37d40d430434a994530284e56337067 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get updated_at for most recently updated video | |
42 def self.last_used | |
43 Video.order(:updated_at).last.updated_at | |
44 end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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