docbrown/spec/services/read_notifications_service_spec.rb
2018-02-28 16:11:08 -05:00

15 lines
388 B
Ruby

require "rails_helper"
RSpec.describe ReadNotificationsService do
let(:user) { create(:user) }
let(:mock) { instance_double(NotificationCounter) }
before do
allow(NotificationCounter).to receive(:new) { mock }
allow(mock).to receive(:set_to_zero).and_return(true)
end
it "sends to buffer" do
expect(described_class.new(user).mark_as_read).to eq("read")
end
end