Skip to content

Commit

Permalink
Add request spec for www redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
rossta committed Jan 1, 2024
1 parent 5cbdc41 commit 32048e7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/requests/www_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require "rails_helper"

RSpec.describe "www", type: :request do
before(:each) do
host! "www.example.com"
end

it "redirects www to root domain" do
get "/"

expect(response.status).to eq(301)
expect(response.headers["Location"]).to eq("http://example.com/")
end
end

0 comments on commit 32048e7

Please sign in to comment.