aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/user_controller_spec.rb
diff options
context:
space:
mode:
authorRobin Houston <robin@lenny.robin>2011-09-08 00:56:59 +0100
committerRobin Houston <robin@lenny.robin>2011-09-08 00:56:59 +0100
commit6e0e5e5bed89ff2093e1cca3fa50310f678565fd (patch)
treeae9a198a8134e90ab2a140d699ed6f3248f467cc /spec/controllers/user_controller_spec.rb
parente286a5a91e449ef01b5ce5f23654d1316bffaf53 (diff)
parenta9002cc8e749df6f5961acab8e3e61fd21987fc1 (diff)
Merge branch 'develop' of git@github.com:sebbacon/alaveteli into develop
Conflicts: app/models/request_mailer.rb
Diffstat (limited to 'spec/controllers/user_controller_spec.rb')
-rw-r--r--spec/controllers/user_controller_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb
index 438fb8c0c..0ba542630 100644
--- a/spec/controllers/user_controller_spec.rb
+++ b/spec/controllers/user_controller_spec.rb
@@ -32,6 +32,13 @@ describe UserController, "when showing a user" do
assigns[:display_user].should == users(:bob_smith_user)
end
+ it "should search the user's contributions" do
+ get :show, :url_name => "bob_smith"
+ assigns[:xapian_requests].results.count.should == 2
+ get :show, :url_name => "bob_smith", :user_query => "money"
+ assigns[:xapian_requests].results.count.should == 1
+ end
+
# Error handling not quite good enough for this yet
# it "should not show unconfirmed users" do
# get :show, :url_name => "silly_emnameem"
@@ -171,6 +178,19 @@ describe UserController, "when signing up" do
deliveries[0].body.should include("not reveal your email")
end
+ it "should send confirmation mail in other languages or different locales" do
+ session[:locale] = "es"
+ post :signup, {:user_signup => { :email => 'new@localhost', :name => 'New Person',
+ :password => 'sillypassword', :password_confirmation => 'sillypassword',
+ }
+ }
+ response.should render_template('confirm')
+
+ deliveries = ActionMailer::Base.deliveries
+ deliveries.size.should == 1
+ deliveries[0].body.should include("No revelaremos su dirección de correo")
+ end
+
it "should send special 'already signed up' mail if you fill the form in with existing registered email " do
post :signup, { :user_signup => { :email => 'silly@localhost', :name => 'New Person',
:password => 'sillypassword', :password_confirmation => 'sillypassword' }