Sha256: 26642cf98c66d176fd54aec65510319e637417c2ee8df2ecc50a87bcc90c5458

Contents?: true

Size: 1.13 KB

Versions: 94

Compression:

Stored size: 1.13 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 -f myapp-dev --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

94 entries across 94 versions & 1 rubygems

Version Path
dpl-1.8.13.travis.1301.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1300.4 spec/provider/firebase_spec.rb
dpl-1.8.12 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1291.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1286.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1283.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1282.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1279.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1272.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1271.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1268.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1260.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1254.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1244.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1236.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1228.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1226.4 spec/provider/firebase_spec.rb
dpl-1.8.12.travis.1223.4 spec/provider/firebase_spec.rb
dpl-1.8.11 spec/provider/firebase_spec.rb
dpl-1.8.11.travis.1222.4 spec/provider/firebase_spec.rb