diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-01-27 00:32:21 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-01-27 00:32:21 +0000 |
commit | cb9c215d3eb3369d7f619d98c55e357247ca72d1 (patch) | |
tree | 52eab973e9695bf6c7fc8e07bb11434dc1a3c900 /spec/controllers/user_controller_spec.rb | |
parent | 673b5cc3939e9abc3bc1f5984f2a61ed45b70529 (diff) | |
parent | 4782d614fa4fbed323c66da4a854ca8182f42fb5 (diff) |
Merge branch 'release/0.5' into develop
Diffstat (limited to 'spec/controllers/user_controller_spec.rb')
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index a90fa18df..81d3ff2e5 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -46,16 +46,19 @@ describe UserController, "when showing a user" do it "should search the user's contributions" do get :show, :url_name => "bob_smith" - assigns[:xapian_requests].results.count.should == 3 + assigns[:xapian_requests].results.map{|x|x[:model].info_request}.should =~ InfoRequest.all(:conditions => "user_id = #{users(:bob_smith_user).id}") + get :show, :url_name => "bob_smith", :user_query => "money" - assigns[:xapian_requests].results.count.should == 1 + assigns[:xapian_requests].results.map{|x|x[:model].info_request}.should == [info_requests(:naughty_chicken_request)] end -# Error handling not quite good enough for this yet -# it "should not show unconfirmed users" do -# get :show, :url_name => "silly_emnameem" -# assigns[:display_users].should == [ users(:silly_name_user) ] -# end + it "should not show unconfirmed users" do + begin + get :show, :url_name => "unconfirmed_user" + rescue => e + end + e.should be_an_instance_of(ActiveRecord::RecordNotFound) + end end |