-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make default config a let value in generator spec
- Loading branch information
1 parent
ae58f30
commit bdb4765
Showing
1 changed file
with
17 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 32,22 @@ | |
let(:file_resource_nested) { tmp_dir 'nested.json' } | ||
let(:file_resource_custom_resource_path) { tmp_dir 'custom_resource_path.json' } | ||
|
||
let(:default_config) { | ||
{ | ||
:controller_base_path => "api/v1", :api_file_path => "#{tmp_dir}", :base_path => "http://api.no.where/", | ||
:attributes => { | ||
:info => { | ||
"title" => "Swagger Sample App", | ||
"description" => "This is a sample description.", | ||
"termsOfServiceUrl" => "http://helloreverb.com/terms/", | ||
"contact" => "[email protected]", | ||
"license" => "Apache 2.0", | ||
"licenseUrl" => "http://www.apache.org/licenses/LICENSE-2.0.html" | ||
} | ||
} | ||
} | ||
} | ||
|
||
let(:controllers) { [ | ||
"fixtures/controllers/sample_controller", | ||
"fixtures/controllers/nested_controller", | ||
|
@@ -100,20 116,7 @@ | |
end | ||
end | ||
context "with controller base path" do | ||
let(:config) { Swagger::Docs::Config.register_apis({ | ||
DEFAULT_VER => {:controller_base_path => "api/v1", :api_file_path => "#{tmp_dir}", :base_path => "http://api.no.where/", | ||
:attributes => { | ||
:info => { | ||
"title" => "Swagger Sample App", | ||
"description" => "This is a sample description.", | ||
"termsOfServiceUrl" => "http://helloreverb.com/terms/", | ||
"contact" => "[email protected]", | ||
"license" => "Apache 2.0", | ||
"licenseUrl" => "http://www.apache.org/licenses/LICENSE-2.0.html" | ||
} | ||
} | ||
} | ||
})} | ||
let(:config) { Swagger::Docs::Config.register_apis({DEFAULT_VER => default_config})} | ||
let(:file_resource) { tmp_dir 'sample.json' } | ||
let(:resource) { file_resource.read } | ||
let(:response) { JSON.parse(resource) } | ||
|