Sha256: 749b396a45857702eff99dc24d231d493afec384893543ce7b9286c0c733eb05

Contents?: true

Size: 907 Bytes

Versions: 2

Compression:

Stored size: 907 Bytes

Contents

require "spec_helper"

RSpec.describe "suspenders:production:single_redirect", type: :generator do
  context "generate" do
    it "adds Rack::CanonicalHost to the production middleware" do
      with_app { generate("suspenders:production:single_redirect") }
      middleware_canonical_host = %r{config.middleware.use Rack::CanonicalHost, ENV.fetch\("APPLICATION_HOST"\)}

      expect("config/environments/production.rb").to match_contents(
        middleware_canonical_host
      )
    end
  end

  context "destroy" do
    it "removes Rack::CanonicalHost from the production middleware" do
      with_app { destroy("suspenders:production:single_redirect") }
      middleware_canonical_host = %r{config.middleware.use Rack::CanonicalHost, ENV.fetch\("APPLICATION_HOST"\)}

      expect("config/environments/production.rb").not_to match_contents(
        middleware_canonical_host
      )
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
suspenders-1.55.1 spec/features/production/single_redirect_spec.rb
suspenders-1.55.0 spec/features/production/single_redirect_spec.rb