diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-05-11 10:26:56 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-05-11 10:26:56 +0100 |
commit | eb8996b0b590117b841fd02d7473dfa10aa133bb (patch) | |
tree | 49d4c428f1bc5a59dc239c94103815a3f4ffc81e | |
parent | 4a1d5613008ecd36769019e622f061fae12d02fa (diff) |
Correctly create tracks for searches that are filtered by variety:authority via the search UI
-rw-r--r-- | app/models/track_thing.rb | 2 | ||||
-rw-r--r-- | spec/models/track_thing_spec.rb | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb index 2a1235e11..bdcd87e4f 100644 --- a/app/models/track_thing.rb +++ b/app/models/track_thing.rb @@ -175,7 +175,7 @@ class TrackThing < ActiveRecord::Base query += " variety:sent" when "users" query += " variety:user" - when "authorities" + when "bodies" query += " variety:authority" end end diff --git a/spec/models/track_thing_spec.rb b/spec/models/track_thing_spec.rb index 93f407475..345629bd6 100644 --- a/spec/models/track_thing_spec.rb +++ b/spec/models/track_thing_spec.rb @@ -44,5 +44,10 @@ describe TrackThing, "when tracking changes" do end end + it "will create an authority-based track when called using a 'bodies' postfix" do + track_thing = TrackThing.create_track_for_search_query('fancy dog', 'bodies') + track_thing.track_query.should =~ /variety:authority/ + end + end |