Skip to content

Commit

Permalink
strengthen redirect spec
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyBen committed Jun 12, 2016
1 parent c47134d commit f545d20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions spec/fixtures/docroot/No Redirect/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Was not redirected
10 changes: 8 additions & 2 deletions spec/madness/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@

context "in an empty folder" do
it "shows index" do
get '/Empty+Folder'
get '/Empty%20Folder'
expect(last_response).to be_ok
expect(last_response.body).to have_tag 'h1', text: /Index/
expect(last_response.body).to have_tag 'h1', text: /Empty Folder/
end
end

Expand All @@ -60,6 +60,12 @@
follow_redirect!
expect(last_request.url).to match /Redirect\/The%20only%20file%20here/
end

it "does not redirect if the file is README" do
get '/No%20Redirect'
expect(last_response).to be_ok
expect(last_response.body).to have_tag 'p', text: "Was not redirected"
end
end

describe "sass plugin" do
Expand Down

0 comments on commit f545d20

Please sign in to comment.