Sha256: eed4e8571cfa2ca98b2fd3616607c9692f434a788ad4874d6401ac7863bcd963

Contents?: true

Size: 1.82 KB

Versions: 28

Compression:

Stored size: 1.82 KB

Contents

require 'spec_helper'

feature 'Suspend a new project with default configuration' do
  scenario 'specs pass' do
    run_jetfuel

    Dir.chdir(project_path) do
      Bundler.with_clean_env do
        expect(`rake`).to include('0 failures')
      end
    end
  end

  scenario 'staging config is inherited from production' do
    run_jetfuel

    staging_file = IO.read("#{project_path}/config/environments/staging.rb")
    config_stub = "Rails.application.configure do"

    expect(staging_file).to match(/^require_relative 'production'/)
    expect(staging_file).to match(/#{config_stub}/), staging_file
  end

  scenario 'generated .ruby-version is pulled from Suspenders .ruby-version' do
    run_jetfuel

    ruby_version_file = IO.read("#{project_path}/.ruby-version")

    expect(ruby_version_file).to eq "#{RUBY_VERSION}\n"
  end

  scenario 'secrets.yml reads secret from env' do
    run_jetfuel

    secrets_file = IO.read("#{project_path}/config/secrets.yml")

    expect(secrets_file).to match(/secret_key_base: <%= ENV\['SECRET_KEY_BASE'\] %>/)
  end

  scenario 'action mailer support file is added' do
    run_jetfuel

    expect(File).to exist("#{project_path}/spec/support/action_mailer.rb")
  end

  scenario 'newrelic.yml reads NewRelic license from env' do
    run_jetfuel

    newrelic_file = IO.read("#{project_path}/config/newrelic.yml")

    expect(newrelic_file).to match(
      /license_key: '<%= ENV\['NEW_RELIC_LICENSE_KEY'\] %>'/
    )
  end

  scenario 'records pageviews through Segment.io if ENV variable set' do
    run_jetfuel

    expect(analytics_partial).
      to include("<% if ENV['SEGMENT_IO_KEY'] %>")
    expect(analytics_partial).
      to include("window.analytics.load('<%= ENV['SEGMENT_IO_KEY'] %>');")
  end

  def analytics_partial
    IO.read("#{project_path}/app/views/application/_analytics.html.erb")
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
jetfuel-1.19.24 spec/features/new_project_spec.rb
jetfuel-1.19.23 spec/features/new_project_spec.rb
jetfuel-1.19.22 spec/features/new_project_spec.rb
jetfuel-1.19.21 spec/features/new_project_spec.rb
jetfuel-1.19.20 spec/features/new_project_spec.rb
jetfuel-1.19.19 spec/features/new_project_spec.rb
jetfuel-1.19.18 spec/features/new_project_spec.rb
jetfuel-1.19.17 spec/features/new_project_spec.rb
jetfuel-1.19.16 spec/features/new_project_spec.rb
jetfuel-1.19.15 spec/features/new_project_spec.rb
jetfuel-1.19.14 spec/features/new_project_spec.rb
jetfuel-1.19.13 spec/features/new_project_spec.rb
jetfuel-1.19.12 spec/features/new_project_spec.rb
jetfuel-1.19.11 spec/features/new_project_spec.rb
jetfuel-1.19.10 spec/features/new_project_spec.rb
jetfuel-1.19.9 spec/features/new_project_spec.rb
jetfuel-1.19.8 spec/features/new_project_spec.rb
jetfuel-1.19.7 spec/features/new_project_spec.rb
jetfuel-1.19.6 spec/features/new_project_spec.rb
jetfuel-1.19.5 spec/features/new_project_spec.rb