Sha256: 6d367a7f472b4dfa6f825effd631001dd2941222c611f946e63f1b08bc0968ae

Contents?: true

Size: 1.14 KB

Versions: 93

Compression:

Stored size: 1.14 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 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

93 entries across 93 versions & 1 rubygems

Version Path
dpl-1.8.40.travis.2194.5 spec/provider/firebase_spec.rb
dpl-1.8.40.travis.2191.5 spec/provider/firebase_spec.rb
dpl-1.8.40.travis.2174.5 spec/provider/firebase_spec.rb
dpl-1.8.40.travis.2172.5 spec/provider/firebase_spec.rb
dpl-1.8.40.travis.2164.5 spec/provider/firebase_spec.rb
dpl-1.8.39.travis.2162.5 spec/provider/firebase_spec.rb
dpl-1.8.39 spec/provider/firebase_spec.rb
dpl-1.8.39.travis.2157.5 spec/provider/firebase_spec.rb
dpl-1.8.38 spec/provider/firebase_spec.rb
dpl-1.8.38.travis.2156.5 spec/provider/firebase_spec.rb
dpl-1.8.38.travis.2151.5 spec/provider/firebase_spec.rb
dpl-1.8.38.travis.2140.5 spec/provider/firebase_spec.rb
dpl-1.8.37 spec/provider/firebase_spec.rb
dpl-1.8.38.travis.2138.5 spec/provider/firebase_spec.rb
dpl-1.8.37.travis.2137.5 spec/provider/firebase_spec.rb
dpl-1.8.37.travis.2118.5 spec/provider/firebase_spec.rb
dpl-1.8.36 spec/provider/firebase_spec.rb
dpl-1.8.37.travis.2106.5 spec/provider/firebase_spec.rb
dpl-1.8.36.travis.2099.5 spec/provider/firebase_spec.rb
dpl-1.8.35 spec/provider/firebase_spec.rb