From dcc312ac215b57afc648725bb8d64ff287bf7798 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Wed, 15 Feb 2012 10:02:30 +0000 Subject: Merge jpmckinney/bundler --- spec/controllers/user_controller_spec.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'spec/controllers/user_controller_spec.rb') diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 40649b6e1..0d7b19e1e 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -1,8 +1,6 @@ # coding: utf-8 require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') -require 'json' - # XXX Use route_for or params_from to check /c/ links better # http://rspec.rubyforge.org/rspec-rails/1.1.12/classes/Spec/Rails/Example/ControllerExampleGroup.html -- cgit v1.2.3 From 302769c8d848ed958ef214f726f8b0bd9ab359d1 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Wed, 16 May 2012 12:00:48 +0100 Subject: Test for the user's wall. --- spec/controllers/user_controller_spec.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'spec/controllers/user_controller_spec.rb') diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 0d7b19e1e..ab485cb14 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -630,6 +630,26 @@ describe UserController, "when showing JSON version for API" do end +describe UserController, "when viewing the wall" do + integrate_views + + before(:each) do + rebuild_xapian_index + end + + it "should show users stuff on their wall, most recent first" do + user = users(:silly_name_user) + ire = info_request_events(:useless_incoming_message_event) + ire.created_at = DateTime.new(2001,1,1) + session[:user_id] = user.id + get :wall, :url_name => user.url_name + assigns[:feed_results][0].should_not == ire + ire.created_at = Time.now + ire.save! + get :wall, :url_name => user.url_name + assigns[:feed_results][0].should == ire + end +end -- cgit v1.2.3 From e2820105a698d8af93c213f5df31578acda545fe Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Wed, 16 May 2012 12:03:31 +0100 Subject: Make it possible to view other people's activities on their own walls. --- spec/controllers/user_controller_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/controllers/user_controller_spec.rb') diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index ab485cb14..37b8b33dc 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -651,5 +651,11 @@ describe UserController, "when viewing the wall" do assigns[:feed_results][0].should == ire end + it "should show other users' activities on their walls" do + user = users(:silly_name_user) + ire = info_request_events(:useless_incoming_message_event) + get :wall, :url_name => user.url_name + assigns[:feed_results][0].should_not == ire + end end -- cgit v1.2.3 From 6fafad02cfa746a04281ffe4951d0d89ba322f6d Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Wed, 16 May 2012 12:04:23 +0100 Subject: Test for user turning email alerts off. Also includes a fix not to rely on HTTP_REFERER for subsequent redirect. --- spec/controllers/user_controller_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spec/controllers/user_controller_spec.rb') diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 37b8b33dc..7a6c9ac0d 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -658,4 +658,13 @@ describe UserController, "when viewing the wall" do assigns[:feed_results][0].should_not == ire end + it "should allow users to turn their own email alerts on and off" do + user = users(:silly_name_user) + session[:user_id] = user.id + user.receive_email_alerts.should == true + get :set_receive_email_alerts, :receive_email_alerts => 'false', :came_from => "/" + user.reload + user.receive_email_alerts.should_not == true + end + end -- cgit v1.2.3 From 432fe8a00936c34c869a8358ff9c5af67a708403 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Thu, 14 Jun 2012 08:47:36 +0100 Subject: Fix test breakage (really we should use a test app.po rather than the real one for testing!) --- spec/controllers/user_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/controllers/user_controller_spec.rb') diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 7a6c9ac0d..32398c053 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -265,7 +265,7 @@ describe UserController, "when signing up" do deliveries = ActionMailer::Base.deliveries deliveries.size.should == 1 - deliveries[0].body.should include("No revelaremos su dirección de correo") + deliveries[0].body.should include("No revelaremos") end it "should send special 'already signed up' mail if you fill the form in with existing registered email" do -- cgit v1.2.3