Skip to content

Commit

Permalink
Initialize digest_username before using it.
Browse files Browse the repository at this point in the history
Adds intialization of digest_username and digest_password.

Implements PR #116 and PR #124 .
  • Loading branch information
Dennis Sivia authored and perlun committed Apr 21, 2017
1 parent 11cfd67 commit 2178498
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/rack/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class Session
def initialize(mock_session)
@headers = {}
@env = {}
@digest_username = nil
@digest_password = nil

if mock_session.is_a?(MockSession)
@rack_mock_session = mock_session
Expand Down
4 changes: 2 additions & 2 deletions spec/rack/test_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def verb
expect(last_request.POST["foo bar"]).to eq("baz")
end

it "uses application/x-www-form-urlencoded as the CONTENT_TYPE" do
it "uses application/x-www-form-urlencoded as the default CONTENT_TYPE" do
post "/"
expect(last_request.env["CONTENT_TYPE"]).to eq("application/x-www-form-urlencoded")
end
Expand Down Expand Up @@ -546,7 +546,7 @@ def verb

it "does not set a content type" do
delete "/"

expect(last_request.env['CONTENT_TYPE']).to be_nil
end
end
Expand Down

0 comments on commit 2178498

Please sign in to comment.