module GdsApi::TestHelpers::Organisations

def organisation_details_for_slug(slug, content_id=SecureRandom.uuid)

otherwise it will be set to 'Executive agency'
if the slug contains 'ministry' the format will be set to 'Ministerial department'

Constructs a sample organisation
def organisation_details_for_slug(slug, content_id=SecureRandom.uuid)
  {
    "id" => "#{ORGANISATIONS_API_ENDPOINT}/api/organisations/#{slug}",
    "title" => titleize_slug(slug, :title_case => true),
    "format" => (slug =~ /ministry/ ? "Ministerial department" : "Executive agency"),
    "updated_at" => "2013-03-25T13:06:42+00:00",
    "web_url" => "#{PUBLIC_HOST}/government/organisations/#{slug}",
    "details" => {
      "slug" => slug,
      "abbreviation" => acronymize_slug(slug),
      "logo_formatted_name" => titleize_slug(slug, :title_case => true),
      "organisation_brand_colour_class_name" => slug,
      "organisation_logo_type_class_name" => (slug =~ /ministry/ ? "single-identity" : "eo"),
      "closed_at" => nil,
      "govuk_status" => (slug =~ /ministry/ ? "live" : "joining"),
      "content_id" => content_id,
    },
    "parent_organisations" => [
      {
        "id" => "#{ORGANISATIONS_API_ENDPOINT}/api/organisations/#{slug}-parent-1",
        "web_url" => "#{PUBLIC_HOST}/government/organisations/#{slug}-parent-1"
      },
    ],
    "child_organisations" => [
      {
        "id" => "#{ORGANISATIONS_API_ENDPOINT}/api/organisations/#{slug}-child-1",
        "web_url" => "#{PUBLIC_HOST}/government/organisations/#{slug}-child-1"
      },
    ],
  }
end