Module: GdsApi::TestHelpers::CommonResponses
- Included in:
- ContentApi, FactCave, NeedApi, Worldwide
- Defined in:
- lib/gds_api/test_helpers/common_responses.rb
Instance Method Summary collapse
- #plural_response_base ⇒ Object
- #response_base ⇒ Object (also: #singular_response_base)
- #titleize_slug(slug, options = {}) ⇒ Object
Instance Method Details
#plural_response_base ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/gds_api/test_helpers/common_responses.rb', line 21 def plural_response_base response_base.merge( { "description" => "Tags!", "total" => 100, "start_index" => 1, "page_size" => 100, "current_page" => 1, "pages" => 1, "results" => [] } ) end |
#response_base ⇒ Object Also known as: singular_response_base
12 13 14 15 16 17 18 |
# File 'lib/gds_api/test_helpers/common_responses.rb', line 12 def response_base { "_response_info" => { "status" => "ok" } } end |
#titleize_slug(slug, options = {}) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/gds_api/test_helpers/common_responses.rb', line 4 def titleize_slug(slug, = {}) if [:title_case] slug.gsub("-", " ").gsub(/\b./) {|m| m.upcase } else slug.gsub("-", " ").capitalize end end |