Sha256: 1ed60ba6f9e19687e1c1bdb0b702a13b5b65884270d8916c8c4296284546721e

Contents?: true

Size: 1.04 KB

Versions: 9

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe Cradlepoint::CradlepointObject do

  let(:factory_cradlepoint_object) { Cradlepoint::CradlepointObject     }
  let(:cradlepoint_object)         { Cradlepoint::CradlepointObject.new }

  let(:url) { 'https://:@cradlepointecm.com/api/v1/blah' }

  context 'factory' do

    it 'should return the correct url' do
      factory_cradlepoint_object.build_url('/blah').should == url
    end
  end

  context 'initialized object' do

    it 'should return the correct url' do
      cradlepoint_object.build_url('/blah').should == url
    end

    describe '.successful_response?' do

      let(:successful_response) { [] }
      let(:unsuccessful_responses) { [nil, { success: false }] }

      it 'should think a successful response is successful' do
        cradlepoint_object.successful_response?(successful_response).should be_true
      end

      it 'should think unsuccessful responses are unsuccessful' do
        unsuccessful_responses.each { |r| cradlepoint_object.successful_response?(r).should be_false }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cradlepoint-0.2.7.2 spec/cradlepoint_object_spec.rb
cradlepoint-0.2.7.1 spec/cradlepoint_object_spec.rb
cradlepoint-0.2.7 spec/cradlepoint_object_spec.rb
cradlepoint-0.2.6 spec/cradlepoint_object_spec.rb
cradlepoint-0.2.5 spec/cradlepoint_object_spec.rb
cradlepoint-0.2.4 spec/cradlepoint_object_spec.rb
cradlepoint-0.2.3 spec/cradlepoint_object_spec.rb
cradlepoint-0.2.2 spec/cradlepoint_object_spec.rb
cradlepoint-0.2.1 spec/cradlepoint_object_spec.rb