File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
spec/grape/middleware/auth Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 99end
1010
1111class Test < Grape ::API
12- version '1'
13-
1412 http_digest ( { :realm => 'Test Api' , :opaque => 'secret' } ) do |username |
1513 { 'foo' => 'bar' } [ username ]
1614 end
@@ -26,24 +24,24 @@ def app
2624 end
2725
2826 it 'should be a digest authentication challenge' do
29- get '/1/ test'
27+ get '/test'
3028 last_response . should be_challenge
3129 end
3230
3331 it 'should throw a 401 if no auth is given' do
34- get '/1/ test'
32+ get '/test'
3533 last_response . status . should == 401
3634 end
3735
3836 it 'should authenticate if given valid creds' do
3937 digest_authorize "foo" , "bar"
40- get '/1/ test'
38+ get '/test'
4139 last_response . status . should == 200
4240 end
4341
4442 it 'should throw a 401 if given invalid creds' do
4543 digest_authorize "bar" , "foo"
46- get '/1/ test'
44+ get '/test'
4745 last_response . status . should == 401
4846 end
4947end
You can’t perform that action at this time.
0 commit comments