Files
nairobi/spec/controllers/notifications_controller_spec.rb
Julian Herrero d9ba3edc2a mostrar notificaciones a los usuarios cuando alguien comenta en su
debate o responde a su comentario
2016-01-05 17:43:44 +01:00

17 lines
454 B
Ruby

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