2019-04-29 20:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-04 18:31:48 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe PushNotificationPusher do
|
|
|
|
|
|
|
|
it "returns badges url by default" do
|
|
|
|
expect(PushNotificationPusher.get_badge).to eq("/assets/push-notifications/discourse.png")
|
|
|
|
end
|
|
|
|
|
|
|
|
it "returns custom badges url" do
|
2019-01-02 02:29:17 -05:00
|
|
|
upload = Fabricate(:upload)
|
|
|
|
SiteSetting.push_notifications_icon = upload
|
|
|
|
|
|
|
|
expect(PushNotificationPusher.get_badge)
|
|
|
|
.to eq(UrlHelper.absolute(upload.url))
|
2018-05-04 18:31:48 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|