Module: GdsApi::TestHelpers::CommonResponses

Included in:
ContentApi, FactCave, Worldwide
Defined in:
lib/gds_api/test_helpers/common_responses.rb

Instance Method Summary collapse

Instance Method Details

#plural_response_baseObject



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_baseObject 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, options = {})
  if options[:title_case]
    slug.gsub("-", " ").gsub(/\b./) {|m| m.upcase }
  else
    slug.gsub("-", " ").capitalize
  end
end