diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 7e0af8645..efbbd09e6 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -36,8 +36,10 @@ class NotificationsController < ApplicationController pager.replace(result) end - @notifications.each do |n| - n[:note_html] = render_to_string( :partial => 'notify_popup_item', :locals => { :n => n } ) + if request.format != :json + @notifications.each do |n| + n[:note_html] = render_to_string( :partial => 'notify_popup_item', :locals => { :n => n } ) + end end @group_days = @notifications.group_by{|note| I18n.l(note.created_at, :format => I18n.t('date.formats.fullmonth_day')) } diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb index 169e7b8ae..facd6ce2d 100644 --- a/spec/models/notification_spec.rb +++ b/spec/models/notification_spec.rb @@ -17,8 +17,6 @@ describe Notification do :actors => [@person], :recipient_id => @user.id} @note = Notification.new(@opts) - @note.type = 'Notifications::CommentOnPost' - @note.actors =[ @person] end it 'destoys the associated notification_actor' do