diff --git a/app/assets/stylesheets/application.sass.scss b/app/assets/stylesheets/application.sass.scss
index 55dfe87edb..d1b524b340 100644
--- a/app/assets/stylesheets/application.sass.scss
+++ b/app/assets/stylesheets/application.sass.scss
@@ -6,7 +6,6 @@ $govuk-assets-path: "";
@import "components/all";
@import "accessible-autocomplete/dist/accessible-autocomplete.min";
-
.app-primary-navigation {
background-color: govuk-colour("light-grey");
}
@@ -74,4 +73,4 @@ $govuk-assets-path: "";
color: $govuk-focus-text-colour;
}
}
-}
\ No newline at end of file
+}
diff --git a/app/controllers/claims/pages_controller.rb b/app/controllers/claims/pages_controller.rb
index ce1d48e44d..9534305a24 100644
--- a/app/controllers/claims/pages_controller.rb
+++ b/app/controllers/claims/pages_controller.rb
@@ -1,5 +1,5 @@
class Claims::PagesController < ApplicationController
def index
- @school = GiasSchool.first
+ @school = User.first&.schools&.first&.gias_school
end
end
diff --git a/app/helpers/navigation_bar_helper.rb b/app/helpers/navigation_bar_helper.rb
index a1b2d4b1a7..4f1b967553 100644
--- a/app/helpers/navigation_bar_helper.rb
+++ b/app/helpers/navigation_bar_helper.rb
@@ -7,11 +7,11 @@ def navigation_items(_provider)
name: t("navigation_bar.users"),
url: "#",
additional_url:
- "request_access_publish_provider_path(provider.provider_code)"
+ "request_access_publish_provider_path(provider.provider_code)",
},
name: t("navigation_bar.organisation_details"),
url: root_path,
- active: request.path == root_path
+ active: request.path == root_path,
]
end
end
diff --git a/app/views/claims/pages/index.html.erb b/app/views/claims/pages/index.html.erb
index d41c1a01ef..1f1ffa961a 100644
--- a/app/views/claims/pages/index.html.erb
+++ b/app/views/claims/pages/index.html.erb
@@ -3,6 +3,7 @@
current_path: request.path,
current_user: User.first
)) %>
+<% if @school %>
@@ -47,3 +48,4 @@
end;end %>
+<% end %>
\ No newline at end of file
diff --git a/spec/factories/gias_schools.rb b/spec/factories/gias_schools.rb
index f887833f46..f9d2906e15 100644
--- a/spec/factories/gias_schools.rb
+++ b/spec/factories/gias_schools.rb
@@ -24,7 +24,7 @@
factory :gias_school do
sequence(:urn) { _1 }
name { "Hogwarts" }
- sequence(:ukprn) {|n| "fake_uprn_#{n}" }
+ sequence(:ukprn) { |n| "fake_uprn_#{n}" }
telephone { "0123456789" }
website { "www.hogwarts.com" }
address1 { "Hogwarts Castle" }
diff --git a/spec/features/personas/sign_in_as_a_claims_user_persona_spec.rb b/spec/features/personas/sign_in_as_a_claims_user_persona_spec.rb
index aa6ddc93be..7cab5ecbf0 100644
--- a/spec/features/personas/sign_in_as_a_claims_user_persona_spec.rb
+++ b/spec/features/personas/sign_in_as_a_claims_user_persona_spec.rb
@@ -8,8 +8,7 @@
end
scenario "I sign in as persona Anne" do
- given_there_is_an_existing_claims_persona_for("Anne")
- and_given_i_have_a_school
+ given_there_is_an_existing_claims_persona_for_with_a_school("Anne")
when_i_visit_the_claims_personas_page
then_i_see_the_claims_persona_for("Anne")
when_i_click_sign_in_as("Anne")
@@ -18,8 +17,7 @@
end
scenario "I sign in as persona Patricia" do
- given_there_is_an_existing_claims_persona_for("Patricia")
- and_given_i_have_a_school
+ given_there_is_an_existing_claims_persona_for_with_a_school("Patricia")
when_i_visit_the_claims_personas_page
then_i_see_the_claims_persona_for("Patricia")
when_i_click_sign_in_as("Patricia")
@@ -28,8 +26,7 @@
end
scenario "I sign in as persona Mary" do
- given_there_is_an_existing_claims_persona_for("Mary")
- and_given_i_have_a_school
+ given_there_is_an_existing_claims_persona_for_with_a_school("Mary")
when_i_visit_the_claims_personas_page
then_i_see_the_claims_persona_for("Mary")
when_i_click_sign_in_as("Mary")
@@ -38,8 +35,7 @@
end
scenario "I sign in as persona colin" do
- given_there_is_an_existing_claims_persona_for("Colin")
- and_given_i_have_a_school
+ given_there_is_an_existing_claims_persona_for_with_a_school("Colin")
when_i_visit_the_claims_personas_page
then_i_see_the_claims_persona_for("Colin")
when_i_click_sign_in_as("Colin")
@@ -50,12 +46,8 @@
private
-def given_there_is_an_existing_claims_persona_for(persona_name)
- create(:persona, persona_name.downcase.to_sym, service: "claims")
-end
-
-def and_given_i_have_a_school
- create(:gias_school)
+def given_there_is_an_existing_claims_persona_for_with_a_school(persona_name)
+ create(:membership, user: create(:persona, persona_name.downcase.to_sym, service: "claims"), organisation: create(:school))
end
def when_i_visit_the_claims_personas_page
diff --git a/spec/system/claims/pages/home_spec.rb b/spec/system/claims/pages/home_spec.rb
index b95f43623d..1adff79954 100644
--- a/spec/system/claims/pages/home_spec.rb
+++ b/spec/system/claims/pages/home_spec.rb
@@ -10,7 +10,6 @@
when_i_visit_home_page
i_can_see_organisation_details
i_can_see_contact_details
-
end
private
@@ -24,9 +23,9 @@ def when_i_visit_home_page
end
def given_there_is_an_existing_persona_for(persona_name)
- user = create(:persona, persona_name.downcase.to_sym,service:"claims")
- create(:gias_school)
- DfESignInUser.load_from_session({"dfe_sign_in_user"=>{"email"=>user.email},"service" =>:claims})
+ user = create(:persona, persona_name.downcase.to_sym, service: "claims")
+ create(:membership, user:, organisation: create(:school))
+ DfESignInUser.load_from_session({ "dfe_sign_in_user" => { "email" => user.email }, "service" => :claims })
end
def i_can_see_organisation_details
diff --git a/spec/system/claims/view_organisations_spec.rb b/spec/system/claims/view_organisations_spec.rb
index 62b7f87fed..cd32ca4124 100644
--- a/spec/system/claims/view_organisations_spec.rb
+++ b/spec/system/claims/view_organisations_spec.rb
@@ -22,39 +22,39 @@
when_i_click_sign_in(persona)
i_am_redirected_to_the_root_path
end
-end
-private
+ private
-def given_the_claims_persona(persona_name)
- create(:persona, persona_name.downcase.to_sym, service: "claims")
-end
+ def given_the_claims_persona(persona_name)
+ create(:persona, persona_name.downcase.to_sym, service: "claims")
+ end
-def and_persona_has_multiple_organisations(persona)
- school1 = create(:school)
- school2 = create(:school)
- create(:membership, user: persona, organisation: school1)
- create(:membership, user: persona, organisation: school2)
-end
+ def and_persona_has_multiple_organisations(persona)
+ school1 = create(:school)
+ school2 = create(:school)
+ create(:membership, user: persona, organisation: school1)
+ create(:membership, user: persona, organisation: school2)
+ end
-def and_persona_has_one_organisation(persona)
- create(:membership, user: persona, organisation: create(:school))
-end
+ def and_persona_has_one_organisation(persona)
+ create(:membership, user: persona, organisation: create(:school))
+ end
-def when_i_visit_claims_personas
- visit personas_path
-end
+ def when_i_visit_claims_personas
+ visit personas_path
+ end
-def when_i_click_sign_in(persona)
- click_on "Sign In as #{persona.first_name}"
-end
+ def when_i_click_sign_in(persona)
+ click_on "Sign In as #{persona.first_name}"
+ end
-def i_can_see_a_list_marys_claims_organisations(persona)
- expect(page).to have_content("Organisations")
- expect(page).to have_content(persona.schools.first.name)
- expect(page).to have_content(persona.schools.last.name)
-end
+ def i_can_see_a_list_marys_claims_organisations(persona)
+ expect(page).to have_content("Organisations")
+ expect(page).to have_content(persona.schools.first.name)
+ expect(page).to have_content(persona.schools.last.name)
+ end
-def i_am_redirected_to_the_root_path
- expect(page).to have_content("It works!")
+ def i_am_redirected_to_the_root_path
+ expect(page).to have_content("Claim Funding for General Mentors")
+ end
end
diff --git a/spec/system/home_page_spec.rb b/spec/system/home_page_spec.rb
index f3ced58cfa..7cbf86a763 100644
--- a/spec/system/home_page_spec.rb
+++ b/spec/system/home_page_spec.rb
@@ -5,7 +5,6 @@
scenario "User visits the claims homepage" do
given_i_am_on_the_claims_site
- and_given_i_have_a_school
and_i_am_on_the_start_page
i_can_see_the_claims_service_name_in_the_header
and_i_can_see_the_claims_service_value_in_the_page
@@ -28,10 +27,6 @@ def given_i_am_on_the_placements_site
Capybara.app_host = "http://#{ENV["PLACEMENTS_HOST"]}"
end
- def and_given_i_have_a_school
- create(:gias_school)
- end
-
def and_i_am_on_the_start_page
visit "/"
end
diff --git a/spec/system/placements/view_organisations_spec.rb b/spec/system/placements/view_organisations_spec.rb
index bafaea8827..f4d51f510f 100644
--- a/spec/system/placements/view_organisations_spec.rb
+++ b/spec/system/placements/view_organisations_spec.rb
@@ -22,41 +22,41 @@
when_i_click_sign_in(persona)
i_am_redirected_to_the_root_path
end
-end
-private
+ private
-def given_the_placements_persona(persona_name)
- create(:persona, persona_name.downcase.to_sym, service: "placements")
-end
+ def given_the_placements_persona(persona_name)
+ create(:persona, persona_name.downcase.to_sym, service: "placements")
+ end
-def and_persona_has_multiple_organisations(persona)
- school1 = create(:school)
- provider = create(:provider)
- create(:membership, user: persona, organisation: school1)
- create(:membership, user: persona, organisation: provider)
-end
+ def and_persona_has_multiple_organisations(persona)
+ school1 = create(:school)
+ provider = create(:provider)
+ create(:membership, user: persona, organisation: school1)
+ create(:membership, user: persona, organisation: provider)
+ end
-def and_persona_has_one_organisation(persona)
- create(:membership, user: persona, organisation: create(:school))
-end
+ def and_persona_has_one_organisation(persona)
+ create(:membership, user: persona, organisation: create(:school))
+ end
-def when_i_visit_placements_personas
- visit personas_path
-end
+ def when_i_visit_placements_personas
+ visit personas_path
+ end
-def when_i_click_sign_in(persona)
- click_on "Sign In as #{persona.first_name}"
-end
+ def when_i_click_sign_in(persona)
+ click_on "Sign In as #{persona.first_name}"
+ end
-def i_can_see_a_list_marys_placements_organisations(persona)
- expect(page).to have_content("Organisations")
- expect(page).to have_content("Schools")
- expect(page).to have_content("Providers")
- expect(page).to have_content(persona.schools.first.name)
- expect(page).to have_content(persona.providers.first.provider_code)
-end
+ def i_can_see_a_list_marys_placements_organisations(persona)
+ expect(page).to have_content("Organisations")
+ expect(page).to have_content("Schools")
+ expect(page).to have_content("Providers")
+ expect(page).to have_content(persona.schools.first.name)
+ expect(page).to have_content(persona.providers.first.provider_code)
+ end
-def i_am_redirected_to_the_root_path
- expect(page).to have_content("It works!")
+ def i_am_redirected_to_the_root_path
+ expect(page).to have_content("It works!")
+ end
end