mostrar notificaciones a los usuarios cuando alguien comenta en su

debate o responde a su comentario
This commit is contained in:
Julian Herrero
2015-10-06 12:11:20 +02:00
committed by rgarcia
parent ba0ce4e14b
commit d9ba3edc2a
17 changed files with 304 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
require 'rails_helper'
describe NotificationsController do
describe "#index" do
let(:user) { create :user }
let(:notification) { create :notification, user: user }
it "assigns @notifications" do
sign_in user
get :index, debate: { title: 'A sample debate', description: 'this is a sample debate', terms_of_service: 1 }
expect(assigns(:notifications)).to eq user.notifications.unread.recent.for_render
end
end
end