Sha256: f3d74e94f5629a3950f1c17883fad49f102295d93c50b73b53619b25e373370b

Contents?: true

Size: 863 Bytes

Versions: 2

Compression:

Stored size: 863 Bytes

Contents

module LocalServicesHelper
  def make_authority(tier, options)
    authority = FactoryGirl.create(:local_authority,
                                   snac: options[:snac], tier: tier)
    add_service_interaction(authority, options[:lgsl]) if options[:lgsl]
    authority
  end

  def add_service_interaction(existing_authority, lgsl_code)
    FactoryGirl.create(:local_interaction, local_authority: existing_authority,
                       lgsl_code: lgsl_code)
  end

  def make_service(lgsl_code, providing_tier)
    LocalService.create!(lgsl_code: lgsl_code, providing_tier: providing_tier)
  end

  def make_authority_providing(lgsl_code)
    council = FactoryGirl.create(:local_authority, snac: "00AA", tier: "county")
    FactoryGirl.create(:local_interaction, local_authority: council,
                       lgsl_code: lgsl_code)
    council
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
govuk_content_models-37.0.0 lib/govuk_content_models/test_helpers/local_services.rb
govuk_content_models-36.0.0 lib/govuk_content_models/test_helpers/local_services.rb