File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 45
45
expect ( page ) . to have_css "span.string" , text : "Basic #{ Base64 . encode64 ( 'username:password' ) . strip } "
46
46
end
47
47
end
48
+ context "#api_auth:bearer" do
49
+ before do
50
+ GrapeSwaggerRails . options . api_auth = 'bearer'
51
+ GrapeSwaggerRails . options . api_key_name = 'Authorization'
52
+ GrapeSwaggerRails . options . api_key_type = 'header'
53
+ visit '/swagger'
54
+ end
55
+ it 'adds an Authorization header' do
56
+ fill_in 'apiKey' , with : 'token'
57
+ find ( '#endpointListTogger_headers' , visible : true ) . click
58
+ find ( 'a[href="#!/headers/GET_api_headers_format"]' , visible : true ) . click
59
+ click_button 'Try it out!'
60
+ expect ( page ) . to have_css "span.attribute" , text : 'Authorization'
61
+ expect ( page ) . to have_css "span.string" , text : 'Bearer token'
62
+ end
63
+ end
48
64
context "#api_auth:token" do
49
65
before do
50
66
GrapeSwaggerRails . options . api_key_name = 'api_token'
You can’t perform that action at this time.
0 commit comments