File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
docs/v3/source/includes/api_resources Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1111 "description": "Put your apps here!",
1212 "name": "Cloud Foundry",
1313 "version": 123,
14+ "osbapi_version": 456,
1415 "links": {
1516 "self": { "href": "http://api.example.com/v3/info" } ,
1617 "support": { "href": "http://support.example.com" }
2930 "description": "",
3031 "name": "",
3132 "version": 0,
33+ "osbapi_version": "",
3234 "links": {
3335 "self": { "href": "http://api.example.com/v3/info" } ,
3436 "support": { "href": "" }
Original file line number Diff line number Diff line change 1414 description : TestConfig . config [ :info ] [ :description ] ,
1515 name : TestConfig . config [ :info ] [ :name ] ,
1616 version : TestConfig . config [ :info ] [ :version ] ,
17+ osbapi_version : TestConfig . config [ :info ] [ :osbapi_version ] ,
1718 links : {
1819 self : { href : "#{ link_prefix } /v3/info" } ,
1920 support : { href : TestConfig . config [ :info ] [ :support_address ] }
2021 }
2122 }
2223 end
2324
25+ before do
26+ allow ( File ) . to receive ( :exist? ) . and_call_original
27+ allow ( File ) . to receive ( :exist? ) . with ( Rails . root . join ( 'config/osbapi_version' ) . to_s ) . and_return ( true )
28+ allow ( File ) . to receive ( :read ) . with ( Rails . root . join ( 'config/osbapi_version' ) . to_s ) . and_return ( '1.0.0' )
29+
30+ TestConfig . override ( info : TestConfig . config [ :info ] . merge ( osbapi_version : '1.0.0' ) )
31+ end
32+
2433 it 'includes data from the config' do
2534 get '/v3/info'
2635 expect ( Oj . load ( last_response . body ) ) . to match_json_response ( return_info_json )
3847 description : '' ,
3948 name : '' ,
4049 version : 0 ,
41- osbapi_version : 0 ,
50+ osbapi_version : '' ,
4251 links : {
4352 self : { href : "#{ link_prefix } /v3/info" } ,
4453 support : { href : '' }
4857
4958 before do
5059 TestConfig . override ( info : nil )
60+ allow ( File ) . to receive ( :exist? ) . with ( Rails . root . join ( 'config/osbapi_version' ) . to_s ) . and_return ( false )
5161 end
5262
5363 it 'includes has proper empty values' do
You can’t perform that action at this time.
0 commit comments