destroy notifications when marked as read

This commit is contained in:
rgarcia
2016-01-07 12:02:01 +01:00
parent b5e9113718
commit e2f419e625
12 changed files with 120 additions and 84 deletions

View File

@@ -1,21 +0,0 @@
require 'rails_helper'
describe NotificationsController do
describe "#index" do
let(:user) { create :user }
it "mark all notifications as read" do
notifications = [create(:notification, user: user), create(:notification, user: user)]
Notification.all.each do |notification|
expect(notification.read).to be false
end
sign_in user
get :index
Notification.all.each do |notification|
expect(notification.read).to be true
end
end
end
end