Fix tests

lolsob-rspec
Eugen Rochko 2017-01-29 12:25:10 +01:00
parent 9327d05bf7
commit d5a3d0aca2
2 changed files with 12 additions and 8 deletions

View File

@ -23,6 +23,6 @@ class SendPushNotificationService < BaseService
end
def remove_bad_ids(bad_ids)
Device.where(registration_id: bad_ids).delete_all
Device.where(registration_id: bad_ids).delete_all unless bad_ids.empty?
end
end

View File

@ -13,7 +13,11 @@ RSpec.configure do |config|
mocks.verify_partial_doubles = true
end
config.after(:suite) do
config.before :each do
stub_request(:post, 'https://fcm.googleapis.com/fcm/send').to_return(status: 200, body: '')
end
config.after :suite do
FileUtils.rm_rf(Dir["#{Rails.root}/spec/test_files/"])
end
end