aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/general_controller_spec.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-02-06 15:14:01 +0000
committerRobin Houston <robin.houston@gmail.com>2012-02-06 15:14:01 +0000
commit0f541e0cf80ba1135a2ae0ae34d53c7917dec23c (patch)
treed1337eacccad398ea4c41d3709515152eaf637cf /spec/controllers/general_controller_spec.rb
parent3b6e5a692b852a88f55b21a7210f60a6f7cfc24b (diff)
Don’t index unconfirmed users
Closes #415.
Diffstat (limited to 'spec/controllers/general_controller_spec.rb')
-rw-r--r--spec/controllers/general_controller_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb
index 7fc019c64..81f4ed6d5 100644
--- a/spec/controllers/general_controller_spec.rb
+++ b/spec/controllers/general_controller_spec.rb
@@ -198,6 +198,22 @@ describe GeneralController, "when searching" do
assigns[:query].should be_nil
end
+ it "should not show unconfirmed users" do
+ get :search, :combined => ["unconfirmed", "users"]
+ response.should render_template('search')
+ assigns[:xapian_users].results.map{|x|x[:model]}.should == []
+ end
+
+ it "should show newly-confirmed users" do
+ u = users(:unconfirmed_user)
+ u.email_confirmed = true
+ u.save!
+ update_xapian_index
+
+ get :search, :combined => ["unconfirmed", "users"]
+ response.should render_template('search')
+ assigns[:xapian_users].results.map{|x|x[:model]}.should == [u]
+ end
end