module GdsApi::TestHelpers::Organisations
def organisation_details_for_slug(slug)
if the slug contains 'ministry' the format will be set to 'Ministerial department'
Constructs a sample organisation
def organisation_details_for_slug(slug) { "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), "closed_at" => nil, "govuk_status" => (slug =~ /ministry/ ? "live" : "joining"), }, "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