Sha256: 276304620762de596d61fc404ed2100e2980a0e8596652d57ceb233f7c8e0e1b

Contents?: true

Size: 814 Bytes

Versions: 6

Compression:

Stored size: 814 Bytes

Contents

require 'spec_helper'

module FirebaseIdToken
  describe Signature do
    let(:jwt) { JSON.parse File.read('spec/fixtures/files/jwt.json') }
    let(:payload) { JSON.parse File.read('spec/fixtures/files/payload.json') }
    let(:rsa_private) { OpenSSL::PKey::RSA.new(FirebaseIdToken::Testing::Certificates.private_key) }

    before :each do
      FirebaseIdToken.configure do |config|
        config.project_ids = ['firebase-id-token']
      end
      FirebaseIdToken.test!
    end

    describe '#verify' do

      it 'test mode is valid' do
        expect(described_class.verify(jwt['jwt_token'])).to be_a(Hash)
      end

      it 'test mode encode is valid' do
        JWT.encode payload, rsa_private, 'RS256'
        expect(described_class.verify(jwt['jwt_token'])).to be_a(Hash)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
firebase_id_token-3.0.0 spec/firebase_id_token/signature_test_spec.rb
firebase_id_token-2.5.2 spec/firebase_id_token/signature_test_spec.rb
firebase_id_token-2.5.1 spec/firebase_id_token/signature_test_spec.rb
firebase_id_token-2.5.0 spec/firebase_id_token/signature_test_spec.rb
firebase_id_token-2.4.0 spec/firebase_id_token/signature_test_spec.rb
firebase_id_token-2.3.2 spec/firebase_id_token/signature_test_spec.rb