From f545d20a685c2f9c6575e1ef7ccf49a79fc3079e Mon Sep 17 00:00:00 2001 From: DannyB Date: Sun, 12 Jun 2016 15:28:11 +0000 Subject: [PATCH] strengthen redirect spec --- spec/fixtures/docroot/No Redirect/README.md | 1 + spec/madness/server_spec.rb | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 spec/fixtures/docroot/No Redirect/README.md diff --git a/spec/fixtures/docroot/No Redirect/README.md b/spec/fixtures/docroot/No Redirect/README.md new file mode 100644 index 0000000..86215a3 --- /dev/null +++ b/spec/fixtures/docroot/No Redirect/README.md @@ -0,0 +1 @@ +Was not redirected \ No newline at end of file diff --git a/spec/madness/server_spec.rb b/spec/madness/server_spec.rb index dbcb761..fcb72e8 100644 --- a/spec/madness/server_spec.rb +++ b/spec/madness/server_spec.rb @@ -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 @@ -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