Sha256: 38380bb7d3b9d797e179d1915c035816635390ca23f54bae2db132d5aab0038c

Contents?: true

Size: 781 Bytes

Versions: 7

Compression:

Stored size: 781 Bytes

Contents

require 'spec_helper'

describe CandyCheck::PlayStore::VerificationFailure do
  subject { CandyCheck::PlayStore::VerificationFailure.new(attributes) }

  describe 'denied' do
    let(:attributes) do
      {
        'errors'  => [],
        'code'    => 401,
        'message' => 'The current user has insufficient permissions'
      }
    end

    it 'returns the code' do
      subject.code.must_equal 401
    end

    it 'returns the message' do
      subject.message.must_equal 'The current user has insufficient permissions'
    end
  end

  describe 'empty' do
    let(:attributes) { nil }

    it 'returns an unknown code' do
      subject.code.must_equal(-1)
    end

    it 'returns an unknown message' do
      subject.message.must_equal 'Unknown error'
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
candy_check-0.1.2 spec/play_store/verification_failure_spec.rb
candy_check-0.1.1 spec/play_store/verification_failure_spec.rb
candy_check-0.1.0.pre spec/play_store/verification_failure_spec.rb
candy_check-0.0.5 spec/play_store/verification_failure_spec.rb
candy_check-0.0.3 spec/play_store/verification_failure_spec.rb
candy_check-0.0.2 spec/play_store/verification_failure_spec.rb
candy_check-0.0.1 spec/play_store/verification_failure_spec.rb