Sha256: 7186d7cf39b9f783533d897ae6c8a8031f5d5724a30dfca571c3b9ba875ee525

Contents?: true

Size: 1.64 KB

Versions: 11

Compression:

Stored size: 1.64 KB

Contents

require "spec_helper"

RSpec.describe "suspenders:production:email", type: :generator do
  it "generates the configuration for a production email deployment" do
    with_app { generate("suspenders:production:email") }

    expect("config/smtp.rb").to match_contents(%r{SMTP_SETTINGS\s*=})

    expect("config/environments/production.rb").to \
      match_contents(%r{require.+config/smtp})
    expect("config/environments/production.rb").to \
      match_contents(%r{action_mailer.delivery_method\s*=\s*:smtp})
    expect("config/environments/production.rb").to \
      match_contents(%r{action_mailer.smtp_settings\s*=\s*SMTP_SETTINGS})

    expect("app.json").to contain_json(
      env: {
        SMTP_ADDRESS: { required: true },
        SMTP_DOMAIN: { required: true },
        SMTP_PASSWORD: { required: true },
        SMTP_USERNAME: { required: true },
      },
    )
  end

  it "destroys the configuration for a production email deployment" do
    with_app { destroy("suspenders:production:email") }

    expect("config/smtp.rb").not_to exist_as_a_file

    expect("config/environments/production.rb").not_to \
      match_contents(%r{require.+config/smtp})
    expect("config/environments/production.rb").not_to \
      match_contents(%r{action_mailer.delivery_method\s*=\s*:smtp})
    expect("config/environments/production.rb").not_to \
      match_contents(%r{action_mailer.smtp_settings\s*=\s*SMTP_SETTINGS})

    expect("app.json").not_to contain_json(
      env: {
        SMTP_ADDRESS: { required: true },
        SMTP_DOMAIN: { required: true },
        SMTP_PASSWORD: { required: true },
        SMTP_USERNAME: { required: true },
      },
    )
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
suspenders-1.54.1 spec/features/production/email_spec.rb
suspenders-1.54.0 spec/features/production/email_spec.rb
suspenders-1.53.0 spec/features/production/email_spec.rb
welaika-suspenders-2.33 spec/features/production/email_spec.rb
welaika-suspenders-2.32.2 spec/features/production/email_spec.rb
welaika-suspenders-2.32.1 spec/features/production/email_spec.rb
welaika-suspenders-2.32.0 spec/features/production/email_spec.rb
suspenders-1.52.0 spec/features/production/email_spec.rb
suspenders-1.51.0 spec/features/production/email_spec.rb
welaika-suspenders-2.31.0 spec/features/production/email_spec.rb
welaika-suspenders-2.30.0 spec/features/production/email_spec.rb