diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-05-16 12:03:31 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-05-30 13:50:39 +0100 |
commit | e2820105a698d8af93c213f5df31578acda545fe (patch) | |
tree | adb90a8ae47c0825393b94b760728a871ecda40b | |
parent | 3b45584eff8feab3f836d036c26cb24034686d6c (diff) |
Make it possible to view other people's activities on their own walls.
-rw-r--r-- | app/controllers/user_controller.rb | 10 | ||||
-rw-r--r-- | app/views/user/wall.rhtml | 4 | ||||
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 6 |
3 files changed, 13 insertions, 7 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 72e9f63f1..ef013ad1e 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -119,11 +119,11 @@ class UserController < ApplicationController # All tracks for the user if @is_you @track_things = TrackThing.find(:all, :conditions => ["tracking_user_id = ? and track_medium = ?", @display_user.id, 'email_daily'], :order => 'created_at desc') - end - for track_thing in @track_things - # XXX factor out of track_mailer.rb - xapian_object = InfoRequest.full_search([InfoRequestEvent], track_thing.track_query, 'described_at', true, nil, 20, 1) - feed_results += xapian_object.results.map {|x| x[:model]} + for track_thing in @track_things + # XXX factor out of track_mailer.rb + xapian_object = InfoRequest.full_search([InfoRequestEvent], track_thing.track_query, 'described_at', true, nil, 20, 1) + feed_results += xapian_object.results.map {|x| x[:model]} + end end @feed_results = Array(feed_results).sort {|x,y| y.created_at <=> x.created_at}.first(20) diff --git a/app/views/user/wall.rhtml b/app/views/user/wall.rhtml index dd45250bd..190cc0a6d 100644 --- a/app/views/user/wall.rhtml +++ b/app/views/user/wall.rhtml @@ -1,10 +1,10 @@ <% @title = h(@display_user.name) + _(" - wall") %> - +<% if @is_you %> <div class="medium_column"> <p><%= _('You can change the requests and users you are following on <a href="{{profile_url}}">your profile page</a>.', :profile_url => show_user_profile_path) %> <%= render :partial => 'change_receive_email' %> </div> - +<% end %> <div id="user_profile_search"> <% if !@feed_results.nil? %> <% for result in @feed_results %> 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 |