diff options
author | David Cabo <david@calibea.com> | 2011-09-03 15:00:41 +0200 |
---|---|---|
committer | David Cabo <david@calibea.com> | 2011-09-03 15:00:41 +0200 |
commit | aebe196100a231873099744ec33d1e4c7dc0934a (patch) | |
tree | 79ea3ea950e762d120bba34b7c1346db07bc513d /spec/models | |
parent | 1741094c4ff2f8592e5be5c09ee914f37b39039e (diff) | |
parent | 204e5c3a739a2bedf927b2f6aa82c373731bbda8 (diff) |
Merge branch 'develop' of github.com:sebbacon/alaveteli into develop
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/track_mailer_spec.rb | 3 | ||||
-rw-r--r-- | spec/models/track_thing_spec.rb | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/track_mailer_spec.rb b/spec/models/track_mailer_spec.rb index 828904d02..b90ca7e52 100644 --- a/spec/models/track_mailer_spec.rb +++ b/spec/models/track_mailer_spec.rb @@ -21,7 +21,8 @@ describe TrackMailer do @user = mock_model(User, :no_xapian_reindex= => false, :last_daily_track_email= => true, :save! => true, - :url_name => 'test-name') + :url_name => 'test-name', + :get_locale => 'en') User.stub!(:find).and_return([@user]) @user.stub!(:no_xapian_reindex=) end diff --git a/spec/models/track_thing_spec.rb b/spec/models/track_thing_spec.rb index 6b9cd6d4a..1a0324a78 100644 --- a/spec/models/track_thing_spec.rb +++ b/spec/models/track_thing_spec.rb @@ -28,5 +28,15 @@ describe TrackThing, "when tracking changes" do found_track.should == @track_thing end + it "will make some sane descriptions of search-based tracks" do + tests = [['bob variety:user', "users matching text 'bob'"], + ['bob (variety:sent OR variety:followup_sent OR variety:response OR variety:comment) (latest_status:successful OR latest_status:partially_successful OR latest_status:rejected OR latest_status:not_held)', "requests which are successful or unsuccessful or comments matching text 'bob'"], + ['(latest_status:waiting_response OR latest_status:waiting_clarification OR waiting_classification:true)', 'requests which are awaiting a response']] + for query, description in tests + track_thing = TrackThing.create_track_for_search_query(query) + track_thing.track_query_description.should == description + end + end + end |