diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml
index 05f83c9cf..07e49ee10 100644
--- a/app/views/notifications/index.html.haml
+++ b/app/views/notifications/index.html.haml
@@ -18,9 +18,9 @@
.span-8.notifications_for_day
- notes.each do |note|
.stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"}
- - if note.type == "Notifications::StartedSharing"
+ - if note.type == "Notifications::StartedSharing" && contact = current_user.contact_for(note.target)
.right
- = render 'contacts/aspect_dropdown', :contact => current_user.contact_for(note.target), :person => note.target, :hang => 'left'
+ = render 'contacts/aspect_dropdown', :contact => contact, :person => note.target, :hang => 'left'
%span.from
= notification_people_link(note)
diff --git a/spec/controllers/admins_controller_spec.rb b/spec/controllers/admins_controller_spec.rb
index c56bc6e33..e4e1de6fb 100644
--- a/spec/controllers/admins_controller_spec.rb
+++ b/spec/controllers/admins_controller_spec.rb
@@ -58,6 +58,24 @@ describe AdminsController do
end
end
end
+
+ describe '#generate_new_token' do
+ before do
+ AppConfig[:admins] = [@user.username]
+ end
+
+ it 'generates a new token for the current user' do
+ lambda {
+ get 'generate_new_token'
+ }.should change{ @user.reload.authentication_token }
+ end
+
+ it 'displays a token' do
+ get 'generate_new_token'
+ get :user_search
+ response.body.should include(@user.reload.authentication_token)
+ end
+ end
describe '#admin_inviter' do
context 'admin signed in' do
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index 160e438dd..0c2915305 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -138,22 +138,4 @@ describe UsersController do
assigns[:email_prefs]['mentioned'].should be_false
end
end
-
- describe '#generate_new_token' do
- before do
- AppConfig[:admins] = [@user.username]
- end
-
- it 'generates a new token for the current user' do
- lambda {
- get 'generate_new_token'
- }.should change{ @user.reload.authentication_token }
- end
-
- it 'displays a token' do
- get 'generate_new_token'
- response.body.should include(@user.reload.authentication_token)
- end
- end
-
end