Sha256: e5927b33d81fbae6013c6b016ecce905433de1417b4266308d09f7a127486d2d

Contents?: true

Size: 1.41 KB

Versions: 103

Compression:

Stored size: 1.41 KB

Contents

require 'spec_helper'
require 'dpl/provider/firebase'

describe DPL::Provider::Firebase do
  subject :provider do
    described_class.new DummyContext.new, :token => 'abc123'
  end

  describe "#check_auth" do
    it 'should require a token if no FIREBASE_TOKEN is set' do
      provider.options.update(:token => nil)
      expect{ provider.check_auth }.to raise_error("must supply token option or FIREBASE_TOKEN environment variable")
    end

    it 'should allow no token if FIREBASE_TOKEN is set' do
      provider.options.update(:token => nil)
      provider.context.env['FIREBASE_TOKEN'] = 'abc123'
      expect{ provider.check_auth }.not_to raise_error
    end
  end

  describe "#push_app" do
    it 'should include the project specified' do
      provider.options.update(:project => 'myapp-dev')
      expect(provider.context).to receive(:shell).with("firebase deploy --non-interactive --project myapp-dev --token 'abc123'")
      provider.push_app
    end

    it 'should include the message specified' do
      provider.options.update(:message => 'test message')
      expect(provider.context).to receive(:shell).with("firebase deploy --non-interactive --message 'test message' --token 'abc123'")
      provider.push_app
    end

    it 'should default to no project override' do
      expect(provider.context).to receive(:shell).with("firebase deploy --non-interactive --token 'abc123'")
      provider.push_app
    end
  end
end

Version data entries

103 entries across 103 versions & 3 rubygems

Version Path
dpl-firebase-1.10.0 spec/provider/firebase_spec.rb
dpl-firebase-1.10.1.travis.2932.6 spec/provider/firebase_spec.rb
dpl-firebase-1.9.8 spec/provider/firebase_spec.rb
dpl-firebase-1.9.9.travis.2894.6 spec/provider/firebase_spec.rb
dpl-firebase-1.9.8.travis.2891.6 spec/provider/firebase_spec.rb
dpl-firebase-1.9.7 spec/provider/firebase_spec.rb
dpl-firebase-1.9.8.travis.2863.6 spec/provider/firebase_spec.rb
dpl-firebase-1.9.7.travis.2857.6 spec/provider/firebase_spec.rb
dpl-firebase-1.9.7.travis.2853.6 spec/provider/firebase_spec.rb
dpl-firebase-1.9.7.travis.2851.6 spec/provider/firebase_spec.rb
dpl-firebase-1.9.6.travis.2848.6 spec/provider/firebase_spec.rb
dpl-firebase-1.9.6 spec/provider/firebase_spec.rb
dpl-firebase-1.9.6.travis.2837.6 spec/provider/firebase_spec.rb
dpl-firebase-1.9.6.travis.2827.6 spec/provider/firebase_spec.rb
dpl-firebase-1.9.6.travis.2795.5 spec/provider/firebase_spec.rb
dpl-firebase-1.9.6.travis.2794.5 spec/provider/firebase_spec.rb
dpl-firebase-1.9.6.travis.2790.5 spec/provider/firebase_spec.rb
dpl-firebase-1.9.6.travis.2786.5 spec/provider/firebase_spec.rb
dpl-firebase-1.9.6.travis.2785.5 spec/provider/firebase_spec.rb
dpl-firebase-1.9.5.travis.2783.5 spec/provider/firebase_spec.rb