Sha256: 8ea898a8e8eb90d38c8690f82948a5d3d51e71e6158acc31009690c44115e34c
Contents?: true
Size: 857 Bytes
Versions: 28
Compression:
Stored size: 857 Bytes
Contents
require 'functional_spec_helper' describe 'Pushy' do let(:external_device_id) { '5a622ae5813e2875bfdbe496' } let(:response) { instance_double('Net::HTTPResponse', code: 200, body: { id: external_device_id }.to_json) } let(:http) { instance_double('Net::HTTP::Persistent', request: response, shutdown: nil) } let(:app) { Rpush::Pushy::App.create!(name: 'MyApp', api_key: 'my_api_key') } let(:notification) do Rpush::Pushy::Notification.create!(app: app, data: { message: 'test' }, registration_ids: ['id']) end before do allow(Net::HTTP::Persistent).to receive_messages(new: http) end it 'deliveres a notification successfully' do expect { Rpush.push }.to change { notification.reload.delivered }.to(true) end it { expect { Rpush.push }.to change { notification.reload.external_device_id }.to(external_device_id) } end
Version data entries
28 entries across 28 versions & 2 rubygems