Skip to content

Commit

Permalink
Sets up focussed tests and fixes inconsistency (#237)
Browse files Browse the repository at this point in the history
In order to focus on single tests during development rspec supports
the option `filter_run_when_matching`.
We agreed, that it is fine for us to support this in #235.

Since it is important to not push :focus tags to the sourcetree,
a leftover has been removed `focus: true`.

Finally an inconsistency in the use of `basic_authorize` and
`authorize` has been fixed.
This has additional value, since this PR is the base for PR #235,
which is supposed to add more tests for digest_authorization.
Since we will have different ways to authorize, it is very helpful
to make the method explicit within our tests.
  • Loading branch information
Dennis Sivia authored and junaruga committed Sep 24, 2018
1 parent b854dff commit 7a94af8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/rack/test_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def close

describe '#basic_authorize' do
it 'sets the HTTP_AUTHORIZATION header' do
authorize 'bryan', 'secret'
basic_authorize 'bryan', 'secret'
request '/'

expect(last_request.env['HTTP_AUTHORIZATION']).to eq('Basic YnJ5YW46c2VjcmV0')
Expand Down Expand Up @@ -446,7 +446,7 @@ def close
expect(last_response['Content-Type']).to eq('text/html;charset=utf-8')
end

it 'raises an error if no requests have been issued', focus: true do
it 'raises an error if no requests have been issued' do
expect do
last_response
end.to raise_error(Rack::Test::Error)
Expand Down
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
config.mock_with :rspec
config.include Rack::Test::Methods

config.filter_run_when_matching :focus

def app
Rack::Lint.new(Rack::Test::FakeApp.new)
end
Expand Down

0 comments on commit 7a94af8

Please sign in to comment.