Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add executive office org type #397

Merged
merged 4 commits into from

2 participants

@h-lame

Adds new org type (via data_migration) and makes sure they appear at the top of the org list on /government

For: https://www.pivotaltracker.com/story/show/42870995

@h-lame h-lame Add executive office as new organisation type
It appears at the start of the list when in listing order
d473c51
@chrismdp chrismdp was assigned
app/models/organisation_type.rb
((8 lines not shown))
def self.agency_or_public_body
where(arel_table[:name].not_eq("Sub-organisation"))
end
def listing_order
- LISTING_ORDER.index(name)
+ LISTING_ORDER.index(name) || 99

Are we just ensuring that the new types go at the bottom? Can we use an intention-reflecting constant here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
test/functional/organisations_controller_test.rb
((10 lines not shown))
queries_used = count_queries { get :index }
- assert 18 > queries_used, "Expected less than 18 queries, #{queries_used} were counted"
+ assert 21 > queries_used, "Expected less than 18 queries, #{queries_used} were counted"

Message needs updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
h-lame added some commits
@h-lame h-lame Executive office orgs appear at the top of /government/organisations 9e0b7c9
@h-lame h-lame In admin, use listing_order for the org type dropdown
This means making OrganisationType#listing_order return a default (a high number) if it's name is not in the LISTING_ORDER. This because most factory built org types are not from that list.
96f5c20
@h-lame h-lame Add key for Executive office to locales 72ffe85
@h-lame

Rebased to address @chrismdp's comments.

@chrismdp chrismdp merged commit f8e542d into from
@chrismdp chrismdp deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 27, 2013
  1. @h-lame

    Add executive office as new organisation type

    h-lame authored
    It appears at the start of the list when in listing order
  2. @h-lame
  3. @h-lame

    In admin, use listing_order for the org type dropdown

    h-lame authored
    This means making OrganisationType#listing_order return a default (a high number) if it's name is not in the LISTING_ORDER. This because most factory built org types are not from that list.
  4. @h-lame
This page is out of date. Refresh to see the latest.
Showing with 223 additions and 10 deletions.
  1. +3 −6 app/assets/stylesheets/frontend/views/_organisations.scss
  2. +4 −1 app/controllers/organisations_controller.rb
  3. +11 −1 app/models/organisation_type.rb
  4. +1 −1  app/views/admin/organisations/_form.html.erb
  5. +18 −0 app/views/organisations/index.html.erb
  6. +7 −0 config/locales/ar.yml
  7. +3 −0  config/locales/az.yml
  8. +5 −0 config/locales/be.yml
  9. +3 −0  config/locales/bg.yml
  10. +3 −0  config/locales/bn.yml
  11. +4 −0 config/locales/cs.yml
  12. +7 −0 config/locales/cy.yml
  13. +3 −0  config/locales/de.yml
  14. +3 −0  config/locales/dr.yml
  15. +3 −0  config/locales/el.yml
  16. +3 −0  config/locales/en.yml
  17. +3 −0  config/locales/es-419.yml
  18. +3 −0  config/locales/es.yml
  19. +3 −0  config/locales/fa.yml
  20. +3 −0  config/locales/fr.yml
  21. +5 −0 config/locales/he.yml
  22. +3 −0  config/locales/hi.yml
  23. +3 −0  config/locales/hu.yml
  24. +3 −0  config/locales/hy.yml
  25. +3 −0  config/locales/id.yml
  26. +3 −0  config/locales/it.yml
  27. +3 −0  config/locales/ja.yml
  28. +3 −0  config/locales/ka.yml
  29. +3 −0  config/locales/ko.yml
  30. +4 −0 config/locales/lt.yml
  31. +3 −0  config/locales/lv.yml
  32. +3 −0  config/locales/ms.yml
  33. +5 −0 config/locales/pl.yml
  34. +3 −0  config/locales/ps.yml
  35. +3 −0  config/locales/pt.yml
  36. +4 −0 config/locales/ro.yml
  37. +5 −0 config/locales/ru.yml
  38. +3 −0  config/locales/si.yml
  39. +4 −0 config/locales/sk.yml
  40. +3 −0  config/locales/so.yml
  41. +3 −0  config/locales/sq.yml
  42. +5 −0 config/locales/sr.yml
  43. +3 −0  config/locales/sw.yml
  44. +3 −0  config/locales/ta.yml
  45. +3 −0  config/locales/th.yml
  46. +3 −0  config/locales/tk.yml
  47. +3 −0  config/locales/tr.yml
  48. +5 −0 config/locales/uk.yml
  49. +3 −0  config/locales/ur.yml
  50. +3 −0  config/locales/uz.yml
  51. +3 −0  config/locales/vi.yml
  52. +3 −0  config/locales/zh.yml
  53. +1 −0  db/data_migration/20130326153939_add_executive_office_org_type.rb
  54. +4 −0 test/factories/organisation_types.rb
  55. +15 −1 test/functional/organisations_controller_test.rb
  56. +1 −0  test/unit/organisation_type_test.rb
View
9 app/assets/stylesheets/frontend/views/_organisations.scss
@@ -31,15 +31,12 @@
}
- .ministerial-departments {
+ .ministerial-departments, .executive-offices {
margin-bottom: $gutter*2;
h1 {
- padding-top: 0;
- &#departments {
- padding-top: 17px;
- padding-top: 1.7rem;
- }
+ padding-top: 17px;
+ padding-top: 1.7rem;
}
}
View
5 app/controllers/organisations_controller.rb
@@ -9,14 +9,17 @@ def index
ministerial_department_type = OrganisationType.find_by_name('Ministerial department')
non_ministerial_department_type = OrganisationType.find_by_name('Non-ministerial department')
public_corporation_type = OrganisationType.find_by_name('Public corporation')
+ executive_office_type = OrganisationType.find_by_name('Executive office')
+ @executive_offices = Organisation.where(organisation_type_id: executive_office_type).all(include: [:organisation_type, { child_organisations: :organisation_type}])
@ministerial_departments = Organisation.where(organisation_type_id: ministerial_department_type).all(include: [:organisation_type, { child_organisations: :organisation_type}])
@public_corporations = Organisation.where(organisation_type_id: public_corporation_type)
@non_ministerial_departments = Organisation.where(organisation_type_id: non_ministerial_department_type)
@agencies_and_government_bodies = Organisation.where('organisation_type_id NOT IN (?)', [
- ministerial_department_type, non_ministerial_department_type, public_corporation_type
+ ministerial_department_type, non_ministerial_department_type,
+ public_corporation_type, executive_office_type
] + OrganisationType.unlistable).ordered_by_name_ignoring_prefix
end
View
12 app/models/organisation_type.rb
@@ -2,6 +2,7 @@ class OrganisationType < ActiveRecord::Base
validates :name, presence: true, uniqueness: true
LISTING_ORDER = [
+ "Executive office",
"Ministerial department",
"Non-ministerial department",
"Executive agency",
@@ -14,6 +15,7 @@ class OrganisationType < ActiveRecord::Base
"Sub-organisation",
"Other"
]
+ BOTTOM_OF_LISTING_ORDER = 99
def self.in_listing_order
all.sort_by { |ot| ot.listing_order }
@@ -27,12 +29,16 @@ def self.sub_organisation
where(name: "Sub-organisation")
end
+ def self.executive_office
+ where(name: "Executive office")
+ end
+
def self.agency_or_public_body
where(arel_table[:name].not_eq("Sub-organisation"))
end
def listing_order
- LISTING_ORDER.index(name)
+ LISTING_ORDER.index(name) || BOTTOM_OF_LISTING_ORDER
end
def ministerial_department?
@@ -50,4 +56,8 @@ def self.departmental_types
def sub_organisation?
name == "Sub-organisation"
end
+
+ def executive_office?
+ name == 'Executive office'
+ end
end
View
2  app/views/admin/organisations/_form.html.erb
@@ -14,7 +14,7 @@
<%= organisation_form.text_area :description %>
<%= organisation_form.text_field :url %>
<%= organisation_form.label :organisation_type_id, "Organisation type" %>
- <%= organisation_form.select :organisation_type_id, options_from_collection_for_select(OrganisationType.all, "id", "name", organisation.organisation_type_id), {include_blank: true}, class: 'chzn-select', data: { placeholder: "Choose the organisation type..." } %>
+ <%= organisation_form.select :organisation_type_id, options_from_collection_for_select(OrganisationType.in_listing_order, "id", "name", organisation.organisation_type_id), {include_blank: true}, class: 'chzn-select', data: { placeholder: "Choose the organisation type..." } %>
<%= organisation_form.text_field :alternative_format_contact_email, label_text: "Email address for ordering publications or consultations in alternative formats" %>
<%= organisation_form.label :govuk_status, "Status on gov.uk" %>
<%= organisation_form.select :govuk_status, [["Currently live", "live"], ["Coming soon", "joining"], ["Exempt from joining", "exempt"], ["Currently transitioning", "transitioning"]], {}, class: 'chzn-select' %>
View
18 app/views/organisations/index.html.erb
@@ -13,6 +13,24 @@
<div class="block-2">
<div class="inner-block">
+ <div class="heading-block executive-offices js-filter-block">
+ <h1 id="executive-offices">Executive offices</h1>
+ <div class="content">
+ <ol>
+ <% @executive_offices.each do |executive_office| %>
+ <%= content_tag_for :li, executive_office,
+ class: 'department js-filter-item',
+ "data-filter-terms" => filter_terms(executive_office) do %>
+ <h2 id="<%= executive_office.slug %>" class="<%= executive_office.slug %>">
+ <%= link_to organisation_path(executive_office), class: logo_classes(class_name: executive_office.organisation_logo_type.class_name, size: 'medium') do %>
+ <span><%= organisation_logo_name(executive_office, false) %></span>
+ <% end %>
+ </h2>
+ <% end %>
+ <% end %>
+ </ol>
+ </div>
+ </div>
<div class="heading-block ministerial-departments js-hide-department-children js-filter-block">
<h1 id="departments">Ministerial departments</h1>
<div class="content">
View
7 config/locales/ar.yml
@@ -377,6 +377,13 @@ ar:
few:
many:
other: هيئات تنفيذية عامة غير حكومية
+ Executive office:
+ zero:
+ one:
+ two:
+ few:
+ many:
+ other:
Independent monitoring body:
zero:
one: جهاز رقابي مستقل
View
3  config/locales/az.yml
@@ -253,6 +253,9 @@ az:
Executive non-departmental public body:
one: İcraedici ictimai qrumlar
other: İcraedici ictimai qrumlar
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Müstəqil monitorinq qrupu
other: Müstəqil monitorinq qrupları
View
5 config/locales/be.yml
@@ -275,6 +275,11 @@ be:
few:
many:
other:
+ Executive office:
+ one:
+ few:
+ many:
+ other:
Independent monitoring body:
one:
few:
View
3  config/locales/bg.yml
@@ -173,6 +173,9 @@ bg:
Executive non-departmental public body:
one: Изпълнителен неведомствен публичен орган
other: Изпълнителни неведомствени публични органи
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Независим мониторингов орган
other: Независими мониторингови органи
View
3  config/locales/bn.yml
@@ -173,6 +173,9 @@ bn:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
4 config/locales/cs.yml
@@ -225,6 +225,10 @@ cs:
one: Výkonná nevládní agentura
few:
other: Výkonné nevládní agentury
+ Executive office:
+ one:
+ few:
+ other:
Independent monitoring body:
one: Nezavislý monitorovací orgán
few:
View
7 config/locales/cy.yml
@@ -377,6 +377,13 @@ cy:
few:
many:
other: Cyrff cyhoeddus anadrannol gweithredol
+ Executive office:
+ zero:
+ one:
+ two:
+ few:
+ many:
+ other:
Independent monitoring body:
zero:
one: Corff monitro annibynnol
View
3  config/locales/de.yml
@@ -173,6 +173,9 @@ de:
Executive non-departmental public body:
one: Keinem Ministerium unterstelltes öffentliches Exekutivorgan
other: ! 'Keinem Ministerium unterstellte öffentliche Exekutivorgane '
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Unabhängiges Kontrollorgan
other: Unabhängige Kontrollorgane
View
3  config/locales/dr.yml
@@ -173,6 +173,9 @@ dr:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
3  config/locales/el.yml
@@ -173,6 +173,9 @@ el:
Executive non-departmental public body:
one: Δημόσιο μη-κυβερνητικό εκτελεστικό όργανο
other: Δημόσια μη-κυβερνητικά εκτελεστικά όργανα
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Ανεξάρτητο ελεγκτικό σώμα
other: Ανεξάρτητα ελεγκτικά σώματα
View
3  config/locales/en.yml
@@ -317,6 +317,9 @@ en:
Other:
one: Other
other: Others
+ Executive office:
+ one: Executive office
+ other: Executive offices
headings:
plus_others: + others
what_we_do: What we do
View
3  config/locales/es-419.yml
@@ -173,6 +173,9 @@ es-419:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
3  config/locales/es.yml
@@ -173,6 +173,9 @@ es:
Executive non-departmental public body:
one: Organismo ejecutivo público no ministerial
other: Organismos ejecutivos públicos no ministeriales
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Organismo independiente de supervisión
other: Organismos independientes de supervisión
View
3  config/locales/fa.yml
@@ -253,6 +253,9 @@ fa:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
3  config/locales/fr.yml
@@ -173,6 +173,9 @@ fr:
Executive non-departmental public body:
one: Organisme exécutif public non-ministériel
other: Organismes exécutifs publics non-ministériels
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Organisme de surveillance indépendant
other: Organismes de surveillance indépendants
View
5 config/locales/he.yml
@@ -275,6 +275,11 @@ he:
two:
many:
other: מחלקות בקרה עצמאיות
+ Executive office:
+ one:
+ two:
+ many:
+ other:
Independent monitoring body:
one: גוף בקרה עצמאי
two:
View
3  config/locales/hi.yml
@@ -173,6 +173,9 @@ hi:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
3  config/locales/hu.yml
@@ -253,6 +253,9 @@ hu:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
3  config/locales/hy.yml
@@ -173,6 +173,9 @@ hy:
Executive non-departmental public body:
one: Գլխավոր ոչ գերատեսչական հանրայի մարմին
other: Գլխավոր ոչ գերատեսչական հանրային մարմիններ
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Անկախ մոնիտորինգի մարմին
other: Անկախ մոնիտորինգի մարմիններ
View
3  config/locales/id.yml
@@ -254,6 +254,9 @@ id:
Executive non-departmental public body:
one: Badan eksekutif non-departmen
other: Badan-badan eksekutif non-departemen
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Badan pengawas independen
other: Badan-badan pengawas independen
View
3  config/locales/it.yml
@@ -173,6 +173,9 @@ it:
Executive non-departmental public body:
one: Ente pubblico esecutivo non ministeriale
other: Enti pubblici esecutivi non ministeriali
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Ente di controllo autonomo
other: Enti di controllo autonomi
View
3  config/locales/ja.yml
@@ -253,6 +253,9 @@ ja:
Executive non-departmental public body:
one: 非省庁公的機関
other: 非省庁公的機関
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: 第三者評価機関
other: 第三者評価機関
View
3  config/locales/ka.yml
@@ -253,6 +253,9 @@ ka:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
3  config/locales/ko.yml
@@ -253,6 +253,9 @@ ko:
Executive non-departmental public body:
one: 행정 공공기관
other: 행정 공공기관
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: 독립 감시 기구
other: 독립 감시 기구
View
4 config/locales/lt.yml
@@ -224,6 +224,10 @@ lt:
one:
few:
other:
+ Executive office:
+ one:
+ few:
+ other:
Independent monitoring body:
one:
few:
View
3  config/locales/lv.yml
@@ -173,6 +173,9 @@ lv:
Executive non-departmental public body:
one: Kvazi autonoma nevalstiska izpildorganizācija
other: Kvazi autonomas nevalstiskas izpildorganizācijas
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Neatkarīga uzraudzības iestāde
other: Neatkarīgas uzraudzības iestādes
View
3  config/locales/ms.yml
@@ -253,6 +253,9 @@ ms:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
5 config/locales/pl.yml
@@ -275,6 +275,11 @@ pl:
few:
many:
other:
+ Executive office:
+ one:
+ few:
+ many:
+ other:
Independent monitoring body:
one:
few:
View
3  config/locales/ps.yml
@@ -173,6 +173,9 @@ ps:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
3  config/locales/pt.yml
@@ -173,6 +173,9 @@ pt:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
4 config/locales/ro.yml
@@ -224,6 +224,10 @@ ro:
one:
few:
other:
+ Executive office:
+ one:
+ few:
+ other:
Independent monitoring body:
one:
few:
View
5 config/locales/ru.yml
@@ -275,6 +275,11 @@ ru:
few:
many:
other: Исполнительные вневедомственные государственные органы
+ Executive office:
+ one:
+ few:
+ many:
+ other:
Independent monitoring body:
one: Независимый наблюдательный орган
few:
View
3  config/locales/si.yml
@@ -173,6 +173,9 @@ si:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
4 config/locales/sk.yml
@@ -224,6 +224,10 @@ sk:
one:
few:
other:
+ Executive office:
+ one:
+ few:
+ other:
Independent monitoring body:
one:
few:
View
3  config/locales/so.yml
@@ -173,6 +173,9 @@ so:
Executive non-departmental public body:
one: Hay'ad fulineed dowladeed oo aan waax gaar ahayn
other: Hay'ado fulineed dowladeed oo aan waax gaar ahayn
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Hay'ad kormeer oo madax bannaan
other: Hay'ado kormeer oo madax bannaan
View
3  config/locales/sq.yml
@@ -173,6 +173,9 @@ sq:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
5 config/locales/sr.yml
@@ -275,6 +275,11 @@ sr:
few:
many:
other:
+ Executive office:
+ one:
+ few:
+ many:
+ other:
Independent monitoring body:
one:
few:
View
3  config/locales/sw.yml
@@ -173,6 +173,9 @@ sw:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
3  config/locales/ta.yml
@@ -173,6 +173,9 @@ ta:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
3  config/locales/th.yml
@@ -253,6 +253,9 @@ th:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
3  config/locales/tk.yml
@@ -173,6 +173,9 @@ tk:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
3  config/locales/tr.yml
@@ -253,6 +253,9 @@ tr:
Executive non-departmental public body:
one: ! 'Bakanlık dışı bağımsız kamu yönetim kurumu '
other: Bakanlık dışı bağımsız kamu yönetim kurumları
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Bağımsız izleme organı
other: ! 'Bağımsız izleme organları '
View
5 config/locales/uk.yml
@@ -275,6 +275,11 @@ uk:
few:
many:
other: Виконавчі позавідомчі органи державної влади
+ Executive office:
+ one:
+ few:
+ many:
+ other:
Independent monitoring body:
one: Незалежний моніторинговий орган
few:
View
3  config/locales/ur.yml
@@ -173,6 +173,9 @@ ur:
Executive non-departmental public body:
one: نافذ کنندہ غیر شعبہ جاتی عوامی ادارہ
other: نافذ کنندہ غیر شعبہ جاتی عوامی ادارے
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: غیر جانبدار نگراں ادارہ
other: غیر جانبدار نگراں ادارے
View
3  config/locales/uz.yml
@@ -173,6 +173,9 @@ uz:
Executive non-departmental public body:
one:
other:
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one:
other:
View
3  config/locales/vi.yml
@@ -254,6 +254,9 @@ vi:
Executive non-departmental public body:
one: Phòng chuyên trách không thuộc cơ chế công
other: Các phòng chuyên trách không thuộc cơ chế công
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: Cơ chế giám sát độc lập
other: Các cơ chế giám sát độc lập
View
3  config/locales/zh.yml
@@ -253,6 +253,9 @@ zh:
Executive non-departmental public body:
one: 非政府公共执行机构
other: 非政府公共执行机构
+ Executive office:
+ one:
+ other:
Independent monitoring body:
one: 独立监督机构
other: 独立监督机构
View
1  db/data_migration/20130326153939_add_executive_office_org_type.rb
@@ -0,0 +1 @@
+OrganisationType.create(name: 'Executive office', analytics_prefix: 'EO')
View
4 test/factories/organisation_types.rb
@@ -19,4 +19,8 @@
factory :sub_organisation_type, parent: :organisation_type do
name "Sub-organisation"
end
+
+ factory :executive_office_organisation_type, parent: :organisation_type do
+ name "Executive office"
+ end
end
View
16 test/functional/organisations_controller_test.rb
@@ -16,6 +16,18 @@ class OrganisationsControllerTest < ActionController::TestCase
assert_select_object(organisation_1)
end
+ view_test "should display a list of executive offices" do
+ executive_office_type = create(:executive_office_organisation_type)
+ organisation = create(:organisation, organisation_type_id: executive_office_type.id)
+
+ get :index
+
+ assert_select '#executive-offices'
+ assert_select '.executive-offices' do
+ assert_select_object(organisation)
+ end
+ end
+
view_test "should display a list of non-ministerial departments" do
non_ministerial_org_type = create(:non_ministerial_organisation_type)
organisation = create(:organisation, organisation_type_id: non_ministerial_org_type.id)
@@ -70,12 +82,14 @@ class OrganisationsControllerTest < ActionController::TestCase
ministerial_org = create(:ministerial_organisation_type)
non_ministerial_org = create(:non_ministerial_organisation_type)
public_corporation_org = create(:public_corporation_organisation_type)
+ executive_office_org = create(:executive_office_organisation_type)
4.times { create(:organisation, organisation_type_id: ministerial_org.id) }
3.times { create(:organisation, organisation_type_id: non_ministerial_org.id) }
3.times { create(:organisation, organisation_type_id: public_corporation_org.id) }
+ 3.times { create(:organisation, organisation_type_id: executive_office_org.id) }
queries_used = count_queries { get :index }
- assert 18 > queries_used, "Expected less than 18 queries, #{queries_used} were counted"
+ assert 21 > queries_used, "Expected less than 21 queries, #{queries_used} were counted"
end
view_test "shows organisation name and description" do
View
1  test/unit/organisation_type_test.rb
@@ -14,6 +14,7 @@ class OrganisationTypeTest < ActiveSupport::TestCase
test "should be returnable in an ordering suitable for organisational listing" do
type_names = [
+ "Executive office",
"Ministerial department",
"Non-ministerial department",
"Executive agency",
Something went wrong with that request. Please try again.