aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/user_controller_spec.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-27 00:31:59 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-27 00:31:59 +0000
commit4782d614fa4fbed323c66da4a854ca8182f42fb5 (patch)
tree52eab973e9695bf6c7fc8e07bb11434dc1a3c900 /spec/controllers/user_controller_spec.rb
parent8da0080e42076ed5ac0a866a7dde180a9167bdc9 (diff)
parent0b82a80ae60afad0f43b4b60e5ce984ffb9ea8eb (diff)
Merge branch 'wdtk' into release/0.5
Diffstat (limited to 'spec/controllers/user_controller_spec.rb')
-rw-r--r--spec/controllers/user_controller_spec.rb17
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