Created
January 8, 2016 20:09
-
-
Save dydx/309662761d47c9c6a5b2 to your computer and use it in GitHub Desktop.
This is the failing test result after creating the spec for CachedScore AR model
This file contains 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
RockScore | |
returns 0 for unpopular terms | |
returns 10 for popular terms | |
returns mediocre results for mediocre terms | |
does not divide by zero | |
ScoreCache | |
returns cached scores if they exist (FAILED - 1) | |
when the term is not cached | |
recomputes scores (FAILED - 2) | |
stores new scores in the database (FAILED - 3) | |
SearchEngine | |
counts results | |
Failures: | |
1) ScoreCache returns cached scores if they exist | |
Failure/Error: allow(CachedScore).to receive(:for_term).with("microsoft").and_return ( 5.5 ) | |
ActiveRecord::StatementInvalid: | |
Could not find table 'cached_scores' | |
# ./spec/services/score_cache_spec.rb:19:in `block (2 levels) in <top (required)>' | |
2) ScoreCache when the term is not cached recomputes scores | |
Failure/Error: | |
allow(CachedScore).to receive(:for_term).with("microsoft"). | |
and_raise( CachedScore::NoScore ) | |
ActiveRecord::StatementInvalid: | |
Could not find table 'cached_scores' | |
# ./spec/services/score_cache_spec.rb:26:in `block (3 levels) in <top (required)>' | |
3) ScoreCache when the term is not cached stores new scores in the database | |
Failure/Error: | |
allow(CachedScore).to receive(:for_term).with("microsoft"). | |
and_raise( CachedScore::NoScore ) | |
ActiveRecord::StatementInvalid: | |
Could not find table 'cached_scores' | |
# ./spec/services/score_cache_spec.rb:26:in `block (3 levels) in <top (required)>' | |
Finished in 0.04174 seconds (files took 2.23 seconds to load) | |
8 examples, 3 failures | |
Failed examples: | |
rspec ./spec/services/score_cache_spec.rb:18 # ScoreCache returns cached scores if they exist | |
rspec ./spec/services/score_cache_spec.rb:31 # ScoreCache when the term is not cached recomputes scores | |
rspec ./spec/services/score_cache_spec.rb:35 # ScoreCache when the term is not cached stores new scores in the database |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment