Sha256: 0c0d44611597d8e7cc81a19aa82a59299f69af8f929bcc3da6e8ff67eb4f9ee6
Contents?: true
Size: 1.25 KB
Versions: 10
Compression:
Stored size: 1.25 KB
Contents
require 'spec_helper' describe Pushbullet::Device do describe '::all' do it 'returns all devices' do VCR.use_cassette('devices_all') do expect(described_class.all).to be_a Array end end it 'returns iterable of Devices' do VCR.use_cassette('devices_all') do described_class.all.each do |cont| expect(cont).to be_a described_class end end end end describe '::create' do context 'given an nickname and a type' do let(:nickname) { 'Letz Device' } let(:type) { 'stream' } it 'returns a device' do VCR.use_cassette('devices_create') do expect(described_class.create nickname, type).to be_a described_class end end end end describe '#destroy' do context 'given a device' do let(:device) { build(:device) } it 'removes a device' do VCR.use_cassette('devices_remove') do expect(device.destroy).to be_truthy end end end end describe '#save' do let(:device) { build(:device) } before { device.nickname = 'Another name' } it 'updates the name of the device' do VCR.use_cassette('devices_update') do expect(device.save).to be_truthy end end end end
Version data entries
10 entries across 8 versions & 2 rubygems