From cb64c33cdf552cc26bded60eb422aaf29d64dfa5 Mon Sep 17 00:00:00 2001
From: pabois <pierreandre.boissinot@noesya.coop>
Date: Fri, 10 Mar 2023 16:17:28 +0100
Subject: [PATCH] fix alumni

---
 app/views/extranet/alumni/persons/show.html.erb    |  2 +-
 config/application.sample.yml                      |  5 +++--
 .../alumni/organizations_controller_test.rb        |  8 --------
 .../extranet/organizations_controller_test.rb      | 14 ++++++++++++++
 4 files changed, 18 insertions(+), 11 deletions(-)
 create mode 100644 test/controllers/extranet/organizations_controller_test.rb

diff --git a/app/views/extranet/alumni/persons/show.html.erb b/app/views/extranet/alumni/persons/show.html.erb
index b3c9d0fca..33896432b 100644
--- a/app/views/extranet/alumni/persons/show.html.erb
+++ b/app/views/extranet/alumni/persons/show.html.erb
@@ -16,7 +16,7 @@
 
     <div class="experiences mt-4">
       <ul class="list-unstyled">
-        <% person&.cohorts&.each do |cohort| %>
+        <% @person&.cohorts&.each do |cohort| %>
           <li class="experiences__experience py-4 border-top">
             <div class="row">
               <div class="col-md-6">
diff --git a/config/application.sample.yml b/config/application.sample.yml
index f273685fe..105eafe95 100644
--- a/config/application.sample.yml
+++ b/config/application.sample.yml
@@ -1,6 +1,4 @@
 APPLICATION_ENV: development
-# Can be used when working on two incompatible branches (e.g. main & i18n)
-OSUNY_DEVELOPMENT_DBNAME:
 
 BUGSNAG_JAVASCRIPT_KEY:
 BUGSNAG_RUBY_KEY:
@@ -8,6 +6,9 @@ BUGSNAG_RUBY_KEY:
 MAIL_FROM_DEFAULT_ADDRESS:
 MAIL_FROM_DEFAULT_NAME:
 
+  # Can be used when working on two incompatible branches (e.g. main & i18n)
+OSUNY_DEVELOPMENT_DBNAME:
+
 OSUNY_STAGING_APP_NAME:
 OSUNY_STAGING_PG_ADDON_ID:
 
diff --git a/test/controllers/extranet/alumni/organizations_controller_test.rb b/test/controllers/extranet/alumni/organizations_controller_test.rb
index 4ae389477..fa9557a8b 100644
--- a/test/controllers/extranet/alumni/organizations_controller_test.rb
+++ b/test/controllers/extranet/alumni/organizations_controller_test.rb
@@ -8,14 +8,6 @@ class Extranet::Alumni::OrganizationsControllerTest < ActionDispatch::Integratio
     assert_response(:success)
   end
 
-  def test_search
-    get alumni_search_university_organizations_path(term: "Organisation de test")
-    assert_response(:success)
-    results = JSON.parse(response.body)
-    assert_equal(1, results.size)
-    assert_equal("Organisation de test", results.first["label"])
-  end
-
   def test_show
     get alumni_university_organization_path(university_organizations(:default_organization))
     assert_response(:success)
diff --git a/test/controllers/extranet/organizations_controller_test.rb b/test/controllers/extranet/organizations_controller_test.rb
new file mode 100644
index 000000000..112be04e1
--- /dev/null
+++ b/test/controllers/extranet/organizations_controller_test.rb
@@ -0,0 +1,14 @@
+require "test_helper"
+
+class Extranet::OrganizationsControllerTest < ActionDispatch::IntegrationTest
+  include ExtranetSetup
+
+  def test_search
+    get search_organizations_path(term: "Organisation de test")
+    assert_response(:success)
+    results = JSON.parse(response.body)
+    assert_equal(1, results.size)
+    assert_equal("Organisation de test", results.first["label"])
+  end
+
+end
-- 
GitLab