mostrar notificaciones a los usuarios cuando alguien comenta en su
debate o responde a su comentario
This commit is contained in:
16
spec/controllers/notifications_controller_spec.rb
Normal file
16
spec/controllers/notifications_controller_spec.rb
Normal 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
|
||||
Reference in New Issue
Block a user