Sha256: 37feb3f174388fd9a28c0ebd23f028ae89dcff3c2156b230be6359bb63a5c804

Contents?: true

Size: 1.3 KB

Versions: 12

Compression:

Stored size: 1.3 KB

Contents

require 'unit_spec_helper'

describe Rpush::Client::ActiveRecord::App do
  it 'does not validate an app with an invalid certificate' do
    app = Rpush::Client::ActiveRecord::Apns::App.new(name: 'test', environment: 'development', certificate: 'foo')
    app.valid?
    app.errors[:certificate].should eq ['Certificate value must contain a certificate and a private key.']
  end

  it 'validates a certificate without a password' do
    app = Rpush::Client::ActiveRecord::Apns::App.new name: 'test', environment: 'development', certificate: TEST_CERT
    app.valid?
    app.errors[:certificate].should eq []
  end

  it 'validates a certificate with a password' do
    app = Rpush::Client::ActiveRecord::Apns::App.new name: 'test', environment: 'development',
                                                     certificate: TEST_CERT_WITH_PASSWORD, password: 'fubar'
    app.valid?
    app.errors[:certificate].should eq []
  end

  it 'validates a certificate with an incorrect password' do
    app = Rpush::Client::ActiveRecord::Apns::App.new name: 'test', environment: 'development',
                                                     certificate: TEST_CERT_WITH_PASSWORD, password: 'incorrect'
    app.valid?
    app.errors[:certificate].should eq ["Certificate value must contain a certificate and a private key."]
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rpush-2.2.0-java spec/unit/client/active_record/apns/app_spec.rb
rpush-2.2.0 spec/unit/client/active_record/apns/app_spec.rb
rpush-2.1.0-java spec/unit/client/active_record/apns/app_spec.rb
rpush-2.1.0 spec/unit/client/active_record/apns/app_spec.rb
rpush-2.0.1-java spec/unit/client/active_record/apns/app_spec.rb
rpush-2.0.1 spec/unit/client/active_record/apns/app_spec.rb
rpush-2.0.0-java spec/unit/client/active_record/apns/app_spec.rb
rpush-2.0.0 spec/unit/client/active_record/apns/app_spec.rb
rpush-2.0.0.rc1-java spec/unit/client/active_record/apns/app_spec.rb
rpush-2.0.0.rc1 spec/unit/client/active_record/apns/app_spec.rb
rpush-2.0.0.beta2 spec/unit/client/active_record/apns/app_spec.rb
rpush-2.0.0.beta1 spec/unit/client/active_record/apns/app_spec.rb