Sha256: 3c091d35acf08f762b1d802afc282dd4bf47d9bfa08eb5e8d8a7f9954f190227

Contents?: true

Size: 1.63 KB

Versions: 15

Compression:

Stored size: 1.63 KB

Contents

require "spec_helper"

module Suspenders
  module Adapters
    RSpec.describe Heroku do
      it "sets the heroku remotes" do
        setup_file = "bin/setup"
        app_builder = double(app_name: app_name)
        allow(app_builder).to receive(:append_file)

        Heroku.new(app_builder).set_heroku_remotes

        expect(app_builder).to have_received(:append_file).
          with(setup_file, /heroku join --app #{app_name.dasherize}-production/)
        expect(app_builder).to have_received(:append_file).
          with(setup_file, /heroku join --app #{app_name.dasherize}-staging/)
      end

      it "sets the heroku rails secrets" do
        app_builder = double(app_name: app_name)
        allow(app_builder).to receive(:run)

        Heroku.new(app_builder).set_heroku_rails_secrets

        expect(app_builder).to(
          have_configured_var("staging", "SECRET_KEY_BASE"),
        )
        expect(app_builder).to(
          have_configured_var("production", "SECRET_KEY_BASE"),
        )
      end

      it "sets the application host" do
        app_builder = double(app_name: app_name)
        allow(app_builder).to receive(:run)

        Heroku.new(app_builder).set_heroku_application_host

        expect(app_builder).to(
          have_configured_var("staging", "APPLICATION_HOST"),
        )

        expect(app_builder).to(
          have_configured_var("production", "APPLICATION_HOST"),
        )
      end

      def app_name
        SuspendersTestHelpers::APP_NAME
      end

      def have_configured_var(remote_name, var)
        have_received(:run).with(/config:add #{var}=.+ --remote #{remote_name}/)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
voyage-1.44.0.7 spec/adapters/heroku_spec.rb
voyage-1.44.0.6 spec/adapters/heroku_spec.rb
voyage-1.44.0.5 spec/adapters/heroku_spec.rb
voyage-1.44.0.4 spec/adapters/heroku_spec.rb
voyage-1.44.0.3 spec/adapters/heroku_spec.rb
voyage-1.44.0.2 spec/adapters/heroku_spec.rb
voyage-1.44.0.1 spec/adapters/heroku_spec.rb
suspenders-1.44.0 spec/adapters/heroku_spec.rb
suspenders-1.43.0 spec/adapters/heroku_spec.rb
suspenders-1.42.0 spec/adapters/heroku_spec.rb
suspenders-1.41.0 spec/adapters/heroku_spec.rb
welaika-suspenders-2.25.0 spec/adapters/heroku_spec.rb
suspenders-1.40.0 spec/adapters/heroku_spec.rb
suspenders-1.39.0 spec/adapters/heroku_spec.rb
voyage-1.0 spec/adapters/heroku_spec.rb