diff --git a/app/controllers/chapters_controller.rb b/app/controllers/chapters_controller.rb
index ea08450c..ca0a19e6 100644
--- a/app/controllers/chapters_controller.rb
+++ b/app/controllers/chapters_controller.rb
@@ -37,7 +37,7 @@ def all
end
# Show statistics of all chapters
- def chapterstats
+ def stats
end
# Create a chapter (show the form)
diff --git a/app/controllers/privacypolicies_controller.rb b/app/controllers/privacypolicies_controller.rb
index 51b1cd36..5862871a 100644
--- a/app/controllers/privacypolicies_controller.rb
+++ b/app/controllers/privacypolicies_controller.rb
@@ -14,7 +14,7 @@ def index
end
# Show the last privacy policy
- def last_policy
+ def last
@last_policy = Privacypolicy.where(:online => true).order(:publication_time).last
if @last_policy.nil?
flash[:danger] = "Le site n'a actuellement aucune politique de confidentalité."
diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb
index 67366d1d..dec0a890 100644
--- a/app/controllers/problems_controller.rb
+++ b/app/controllers/problems_controller.rb
@@ -5,12 +5,17 @@ class ProblemsController < ApplicationController
before_action :admin_user, only: [:new, :create, :edit, :update, :destroy, :order, :put_online, :edit_explanation, :update_explanation, :edit_markscheme, :update_markscheme, :add_prerequisite, :delete_prerequisite, :add_virtualtest, :manage_externalsolutions]
before_action :get_problem, only: [:show, :edit, :update, :destroy, :edit_explanation, :update_explanation, :edit_markscheme, :update_markscheme, :order, :add_prerequisite, :delete_prerequisite, :add_virtualtest, :put_online, :manage_externalsolutions]
- before_action :get_section, only: [:new, :create]
+ before_action :get_section, only: [:index, :new, :create]
before_action :offline_problem, only: [:destroy, :put_online, :add_prerequisite, :delete_prerequisite, :add_virtualtest]
before_action :user_that_can_see_problem, only: [:show]
before_action :can_be_online, only: [:put_online]
+ # Show problems of a section
+ def index
+ flash.now[:info] = @no_new_submission_message if @no_new_submission
+ end
+
# Show one problem
def show
flash.now[:info] = @no_new_submission_message if @no_new_submission and params.has_key?("sub") and params[:sub] == "0"
@@ -92,7 +97,7 @@ def update
def destroy
@problem.destroy
flash[:success] = "Problème supprimé."
- redirect_to pb_sections_path(@problem.section)
+ redirect_to section_problems_path(@problem.section)
end
# Put a problem online
diff --git a/app/controllers/sections_controller.rb b/app/controllers/sections_controller.rb
index ca89e30d..42409ead 100644
--- a/app/controllers/sections_controller.rb
+++ b/app/controllers/sections_controller.rb
@@ -10,11 +10,6 @@ class SectionsController < ApplicationController
def show
end
- # Show the problems of a section
- def show_problems
- flash.now[:info] = @no_new_submission_message if @no_new_submission
- end
-
# Update a section (show the form)
def edit
end
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index bf437399..a0295109 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -35,5 +35,4 @@ def destroy
sign_out
redirect_to root_path
end
-
end
diff --git a/app/controllers/submissions_controller.rb b/app/controllers/submissions_controller.rb
index 24ba88dc..5dcf29be 100644
--- a/app/controllers/submissions_controller.rb
+++ b/app/controllers/submissions_controller.rb
@@ -2,11 +2,11 @@
class SubmissionsController < ApplicationController
skip_before_action :error_if_invalid_csrf_token, only: [:create, :create_intest, :update_draft, :update_intest] # Do not forget to check @invalid_csrf_token instead!
- before_action :signed_in_user, only: [:allsub, :allmysub, :allnewsub, :allmynewsub]
+ before_action :signed_in_user, only: [:all, :allmy, :allnew, :allmynew]
before_action :signed_in_user_danger, only: [:create, :create_intest, :update_draft, :update_intest, :read, :unread, :star, :unstar, :reserve, :unreserve, :destroy, :update_score, :uncorrect, :search_script]
before_action :non_admin_user, only: [:create, :create_intest, :update_draft, :update_intest]
before_action :root_user, only: [:update_score, :star, :unstar]
- before_action :corrector_user, only: [:allsub, :allmysub, :allnewsub, :allmynewsub]
+ before_action :corrector_user, only: [:all, :allmy, :allnew, :allmynew]
before_action :get_submission, only: [:destroy, :read, :unread, :reserve, :unreserve, :star, :unstar, :update_draft, :update_intest, :update_score, :uncorrect, :search_script]
before_action :get_problem, only: [:create, :create_intest, :index]
@@ -250,17 +250,17 @@ def search_script
end
# Show all submissions
- def allsub
+ def all
@submissions = Submission.joins(:problem).joins(problem: :section).select(needed_columns_for_submissions).includes(:user, followings: :user).where(:visible => true).order("submissions.last_comment_time DESC").paginate(page: params[:page]).to_a
end
# Show all submissions in which we took part
- def allmysub
+ def allmy
@submissions = current_user.sk.followed_submissions.joins(:problem).joins(problem: :section).select(needed_columns_for_submissions).includes(:user).where("status != ? AND status != ?", Submission.statuses[:draft], Submission.statuses[:waiting]).order("submissions.last_comment_time DESC").paginate(page: params[:page]).to_a
end
# Show all new submissions
- def allnewsub
+ def allnew
levels = [1, 2, 3, 4, 5]
if (params.has_key?:levels)
levels = []
@@ -276,7 +276,7 @@ def allnewsub
end
# Show all new comments to submissions in which we took part
- def allmynewsub
+ def allmynew
@submissions = current_user.sk.followed_submissions.joins(:problem).joins(problem: :section).select(needed_columns_for_submissions).includes(:user).where(followings: {read: false}).order("submissions.last_comment_time").to_a
@submissions_other = Submission.joins(:problem).joins(problem: :section).select(needed_columns_for_submissions).includes(:user, followings: :user).where(:status => :wrong_to_read).order("submissions.last_comment_time").to_a
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 689e6939..0464009d 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,6 +1,6 @@
#encoding: utf-8
class UsersController < ApplicationController
- before_action :signed_in_user, only: [:edit, :notifs, :groups, :read_legal, :followed_users, :unset_follow_message]
+ before_action :signed_in_user, only: [:edit, :notifs, :groups, :read_legal, :followed, :unset_follow_message]
before_action :signed_in_user_danger, only: [:destroy, :destroydata, :update, :set_administrator, :take_skin, :leave_skin, :set_wepion, :unset_wepion, :set_corrector, :unset_corrector, :change_group, :follow, :unfollow, :set_follow_message, :set_can_change_name, :unset_can_change_name, :ban_temporarily]
before_action :admin_user, only: [:set_wepion, :unset_wepion, :change_group]
before_action :root_user, only: [:take_skin, :set_administrator, :destroy, :destroydata, :set_corrector, :unset_corrector, :validate_names, :validate_name, :change_name, :set_can_change_name, :unset_can_change_name, :ban_temporarily]
@@ -81,7 +81,7 @@ def index
end
# Show all followed users
- def followed_users
+ def followed
fill_sections_max_score
@all_users = current_user.sk.followed_users.where(:admin => false).to_a
@@ -93,7 +93,8 @@ def followed_users
fill_user_info(@all_users)
end
- def search_user
+ # Search for users by name
+ def search
return unless params.has_key?:search
search = params[:search].dup # real copy
diff --git a/app/views/chapters/chapterstats.html.erb b/app/views/chapters/stats.erb
similarity index 100%
rename from app/views/chapters/chapterstats.html.erb
rename to app/views/chapters/stats.erb
diff --git a/app/views/discussions/new.html.erb b/app/views/discussions/new.html.erb
index 0a6e197e..a9f42248 100644
--- a/app/views/discussions/new.html.erb
+++ b/app/views/discussions/new.html.erb
@@ -38,7 +38,7 @@ var UserNotFound = function () {
<%= link_to "Destinataire introuvable ?", "javascript:UserNotFound()" %>
-
Seuls les utilisateurs actifs récemment sont listés ci-dessus. Pour envoyer un message à un autre utilisateur, <%= link_to "cherchez-le", search_user_path %>, consultez son profil et cliquez sur "Envoyer un message".
+ Seuls les utilisateurs actifs récemment sont listés ci-dessus. Pour envoyer un message à un autre utilisateur, <%= link_to "cherchez-le", search_users_path %>, consultez son profil et cliquez sur "Envoyer un message".
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb
index 1d36394b..17840b46 100644
--- a/app/views/layouts/_footer.html.erb
+++ b/app/views/layouts/_footer.html.erb
@@ -32,7 +32,7 @@ function setLightTheme() {
- <%= link_to "Confidentialité", last_policy_path %>
+ <%= link_to "Confidentialité", last_privacypolicies_path %>
<%= link_to "À propos", about_path %>
<%= link_to "Contact", contact_path %>
diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb
index b4004fea..5f89a709 100644
--- a/app/views/layouts/_header.html.erb
+++ b/app/views/layouts/_header.html.erb
@@ -28,21 +28,21 @@
<% num_notifications_new345 = current_user.sk.num_notifications_new([3, 4, 5]) %>
<% num_notifications_update = current_user.sk.num_notifications_update %>
<% classe = (num_notifications_new12[0] + num_notifications_new12[1] > 0 ? "success" : "ld-light-dark-er") %>
- <%= link_to allnewsub_path(:levels => 3), class: "btn btn-#{classe}" do %>
+ <%= link_to allnew_submissions_path(:levels => 3), class: "btn btn-#{classe}" do %>
<%= num_notifications_new12[0] %>
<% if num_notifications_new12[1] > 0 %>
+ <%= num_notifications_new12[1] %> j
<% end %>
<% end %>
<% classe = (num_notifications_new345[0] + num_notifications_new345[1] > 0 ? "danger" : "ld-light-dark-er") %>
- <%= link_to allnewsub_path(:levels => 28), class: "btn btn-#{classe}" do %>
+ <%= link_to allnew_submissions_path(:levels => 28), class: "btn btn-#{classe}" do %>
<%= num_notifications_new345[0] %>
<% if num_notifications_new345[1] > 0 %>
+ <%= num_notifications_new345[1] %> j
<% end %>
<% end %>
<% classe = (num_notifications_update > 0 ? "warning" : "ld-light-dark-er") %>
- <%= link_to "#{num_notifications_update}", allmynewsub_path, class: "btn btn-#{classe}" %>
+ <%= link_to "#{num_notifications_update}", allmynew_submissions_path, class: "btn btn-#{classe}" %>
<% if current_user.sk.root? && num_waiting_starproposals > 0 %>
@@ -100,9 +100,9 @@
Problèmes
diff --git a/app/views/privacypolicies/index.html.erb b/app/views/privacypolicies/index.html.erb
index 614592dc..1f7960e1 100644
--- a/app/views/privacypolicies/index.html.erb
+++ b/app/views/privacypolicies/index.html.erb
@@ -1,6 +1,6 @@
<% provide(:title, 'Politique de confidentialité') %>
-<%= title_2((link_to "Politique de confidentialité", last_policy_path), "Mettre à jour") %>
+<%= title_2((link_to "Politique de confidentialité", last_privacypolicies_path), "Mettre à jour") %>
diff --git a/app/views/sections/_info_problems.html b/app/views/problems/_info.html
similarity index 100%
rename from app/views/sections/_info_problems.html
rename to app/views/problems/_info.html
diff --git a/app/views/problems/edit.html.erb b/app/views/problems/edit.html.erb
index 8e272465..18b6044f 100644
--- a/app/views/problems/edit.html.erb
+++ b/app/views/problems/edit.html.erb
@@ -1,6 +1,6 @@
<% provide(:title, 'Modifier un problème') %>
-<%= title_4("Problèmes", (link_to @problem.section.name, pb_sections_path(@problem.section)), (link_to "Problème ##{ @problem.number }", @problem), "Modifier") %>
+<%= title_4("Problèmes", (link_to @problem.section.name, section_problems_path(@problem.section)), (link_to "Problème ##{ @problem.number }", @problem), "Modifier") %>
<%= form_for(@problem) do |f| %>
<%= render 'form', f: f, problem: @problem %>
diff --git a/app/views/problems/edit_explanation.html.erb b/app/views/problems/edit_explanation.html.erb
index c8a6e684..850a81de 100644
--- a/app/views/problems/edit_explanation.html.erb
+++ b/app/views/problems/edit_explanation.html.erb
@@ -1,6 +1,6 @@
<% provide(:title, "Modifier la solution d'un problème".html_safe) %>
-<%= title_4("Problèmes", (link_to @problem.section.name, pb_sections_path(@problem.section)), (link_to "Problème ##{ @problem.number }", @problem), "Modifier la solution") %>
+<%= title_4("Problèmes", (link_to @problem.section.name, section_problems_path(@problem.section)), (link_to "Problème ##{ @problem.number }", @problem), "Modifier la solution") %>
Énoncé
diff --git a/app/views/problems/edit_markscheme.html.erb b/app/views/problems/edit_markscheme.html.erb
index b907490c..fc6188eb 100644
--- a/app/views/problems/edit_markscheme.html.erb
+++ b/app/views/problems/edit_markscheme.html.erb
@@ -1,6 +1,6 @@
<% provide(:title, "Modifier le marking scheme d'un problème") %>
-<%= title_4("Problèmes", (link_to @problem.section.name, pb_sections_path(@problem.section)), (link_to "Problème ##{ @problem.number }", @problem), "Modifier le marking scheme") %>
+<%= title_4("Problèmes", (link_to @problem.section.name, section_problems_path(@problem.section)), (link_to "Problème ##{ @problem.number }", @problem), "Modifier le marking scheme") %>
Énoncé
diff --git a/app/views/sections/show_problems.html.erb b/app/views/problems/index.html.erb
similarity index 99%
rename from app/views/sections/show_problems.html.erb
rename to app/views/problems/index.html.erb
index 2759f686..5af97309 100644
--- a/app/views/sections/show_problems.html.erb
+++ b/app/views/problems/index.html.erb
@@ -4,7 +4,7 @@
?
-<%= render 'info_problems' %>
+<%= render 'info' %>
<% if !has_enough_points(signed_in? ? current_user.sk : nil) %>
diff --git a/app/views/problems/manage_externalsolutions.html.erb b/app/views/problems/manage_externalsolutions.html.erb
index 0b278436..05fc34be 100644
--- a/app/views/problems/manage_externalsolutions.html.erb
+++ b/app/views/problems/manage_externalsolutions.html.erb
@@ -2,7 +2,7 @@
<% provide(:title, 'Solutions externes') %>
-<%= title_4("Problèmes", (link_to @problem.section.name, pb_sections_path(@problem.section)), (link_to "Problème ##{ @problem.number }", @problem), "Solutions externes") %>
+<%= title_4("Problèmes", (link_to @problem.section.name, section_problems_path(@problem.section)), (link_to "Problème ##{ @problem.number }", @problem), "Solutions externes") %>
Énoncé
diff --git a/app/views/problems/new.html.erb b/app/views/problems/new.html.erb
index 3101d25c..b6725ba6 100644
--- a/app/views/problems/new.html.erb
+++ b/app/views/problems/new.html.erb
@@ -1,6 +1,6 @@
<% provide(:title, 'Créer un problème') %>
-<%= title_3("Problèmes", (link_to @section.name, pb_sections_path(@section)), "Créer un problème") %>
+<%= title_3("Problèmes", (link_to @section.name, section_problems_path(@section)), "Créer un problème") %>
<%= form_for(@problem, url: section_problems_path) do |f| %>
<%= render 'form', f: f, problem: nil %>
diff --git a/app/views/problems/show.html.erb b/app/views/problems/show.html.erb
index 0898ea89..b84f511d 100644
--- a/app/views/problems/show.html.erb
+++ b/app/views/problems/show.html.erb
@@ -4,7 +4,7 @@
<% problem_solved = current_user.sk.pb_solved?(@problem) %>
-<%= title_3("Problèmes", (link_to @problem.section.name, pb_sections_path(@problem.section)), "Problème ##{ @problem.number }#{ (' - Test #' + @problem.virtualtest.number.to_s ) if @problem.virtualtest_id != 0 } #{ '(en construction)' if !@problem.online } (#{ pt } points) ") %>
+<%= title_3("Problèmes", (link_to @problem.section.name, section_problems_path(@problem.section)), "Problème ##{ @problem.number }#{ (' - Test #' + @problem.virtualtest.number.to_s ) if @problem.virtualtest_id != 0 } #{ '(en construction)' if !@problem.online } (#{ pt } points) ") %>
<% if current_user.sk.admin? %>
diff --git a/app/views/submissions/_new_in_test.html.erb b/app/views/submissions/_new_in_test.html.erb
index 8f8747bb..03b9fff1 100644
--- a/app/views/submissions/_new_in_test.html.erb
+++ b/app/views/submissions/_new_in_test.html.erb
@@ -1,4 +1,4 @@
-<%= form_for @submission, url: problem_create_intest_path(@problem), :html => { :multipart => true } do |f| %>
+<%= form_for @submission, url: create_intest_problem_submissions_path(@problem), :html => { :multipart => true } do |f| %>
<%= render 'submissions/form', f: f %>
<%= render 'shared/edit_files' %>
diff --git a/app/views/submissions/allsub.html.erb b/app/views/submissions/all.html.erb
similarity index 100%
rename from app/views/submissions/allsub.html.erb
rename to app/views/submissions/all.html.erb
diff --git a/app/views/submissions/allmysub.html.erb b/app/views/submissions/allmy.html.erb
similarity index 100%
rename from app/views/submissions/allmysub.html.erb
rename to app/views/submissions/allmy.html.erb
diff --git a/app/views/submissions/allmynewsub.html.erb b/app/views/submissions/allmynew.html.erb
similarity index 96%
rename from app/views/submissions/allmynewsub.html.erb
rename to app/views/submissions/allmynew.html.erb
index 2fa579b1..b53b1d61 100644
--- a/app/views/submissions/allmynewsub.html.erb
+++ b/app/views/submissions/allmynew.html.erb
@@ -1,6 +1,6 @@
<% provide(:title, "Commentaires") %>
-<%= title_1("Commentaires") %> - <%= link_to "Tout voir", allmysub_path %>
+<%= title_1("Commentaires") %> - <%= link_to "Tout voir", allmy_submissions_path %>
Qui vous concernent
diff --git a/app/views/submissions/allnewsub.html.erb b/app/views/submissions/allnew.html.erb
similarity index 99%
rename from app/views/submissions/allnewsub.html.erb
rename to app/views/submissions/allnew.html.erb
index 1c360132..fe6e8a12 100644
--- a/app/views/submissions/allnewsub.html.erb
+++ b/app/views/submissions/allnew.html.erb
@@ -2,7 +2,7 @@
<%= title_1("Soumissions") %>
- - <%= link_to "Tout voir", allsub_path %>
+ - <%= link_to "Tout voir", all_submissions_path %>
<% if current_user.sk.root? || current_user.sk.suspicions.count > 0 %>
- <%= link_to "Plagiats", suspicions_path %>
<% end %>
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb
index ebc183ac..e88317f3 100644
--- a/app/views/users/_form.html.erb
+++ b/app/views/users/_form.html.erb
@@ -126,13 +126,13 @@
<%= check_box_tag "consent1", "1", false, :class => "form-check-input", :onchange => "javascript:checkChecked();" %>
- J'ai lu et j'accepte la <%= link_to "politique de confidentialité", last_policy_path, :target => "_blank" %> de Mathraining.
+ J'ai lu et j'accepte la <%= link_to "politique de confidentialité", last_privacypolicies_path, :target => "_blank" %> de Mathraining.
<%= check_box_tag "consent2", "2", false, :class => "form-check-input", :onchange => "javascript:checkChecked();" %>
- J'ai au moins 16 ans, ou j'ai lu et accepté la <%= link_to "politique de confidentialité", last_policy_path, :target => "_blank" %> avec mon tuteur légal.
+ J'ai au moins 16 ans, ou j'ai lu et accepté la <%= link_to "politique de confidentialité", last_privacypolicies_path, :target => "_blank" %> avec mon tuteur légal.
<% end %>
diff --git a/app/views/users/_tabs.html.erb b/app/views/users/_tabs.html.erb
index 34622eb1..a0ec11d1 100644
--- a/app/views/users/_tabs.html.erb
+++ b/app/views/users/_tabs.html.erb
@@ -3,5 +3,5 @@
<% if signed_in? %>
<%= link_to "Utilisateurs suivis", followed_users_path, :class => "nav-link #{ 'active' if t == 2 }" %>
<% end %>
- <%= link_to "Chercher un utilisateur", search_user_path, :class => "nav-link #{ 'active' if t == 3 }" %>
+ <%= link_to "Chercher un utilisateur", search_users_path, :class => "nav-link #{ 'active' if t == 3 }" %>
diff --git a/app/views/users/followed_users.html.erb b/app/views/users/followed.html.erb
similarity index 100%
rename from app/views/users/followed_users.html.erb
rename to app/views/users/followed.html.erb
diff --git a/app/views/users/groups.html.erb b/app/views/users/groups.html.erb
index ee894054..55a629e3 100644
--- a/app/views/users/groups.html.erb
+++ b/app/views/users/groups.html.erb
@@ -9,9 +9,9 @@
<% if current_user.sk.admin? %>
<% if (!params.has_key?:details) %>
- <%= link_to "Afficher les détails", groups_path(:details => 1) %>
+ <%= link_to "Afficher les détails", groups_users_path(:details => 1) %>
<% else %>
- <%= link_to "Masquer les détails", groups_path %>
+ <%= link_to "Masquer les détails", groups_users_path %>
<% end %>
<% end %>
diff --git a/app/views/users/read_legal.html.erb b/app/views/users/read_legal.html.erb
index 688128c4..4c3b0b38 100644
--- a/app/views/users/read_legal.html.erb
+++ b/app/views/users/read_legal.html.erb
@@ -16,7 +16,7 @@ function checkChecked() {
<%= title_1("Nouvelle politique de confidentialité") %>
-Depuis votre dernière visite, notre <%= link_to "politique de confidentialité", last_policy_path, :target => "_blank" %> a été mise à jour.
+Depuis votre dernière visite, notre <%= link_to "politique de confidentialité", last_privacypolicies_path, :target => "_blank" %> a été mise à jour.
Vous pouvez trouver ci-dessous un résumé des modifications apportées au texte depuis la dernière version que vous avez acceptée.
@@ -54,14 +54,14 @@ function checkChecked() {
<%= check_box_tag "consent1", "1", false, :class => "form-check-input", :onchange => "javascript:checkChecked();" %>
- J'ai lu et j'accepte la <%= link_to "politique de confidentialité", last_policy_path, :target => "_blank" %> de Mathraining.
+ J'ai lu et j'accepte la <%= link_to "politique de confidentialité", last_privacypolicies_path, :target => "_blank" %> de Mathraining.
<%= check_box_tag "consent2", "2", false, :class => "form-check-input", :onchange => "javascript:checkChecked();" %>
- J'ai au moins 16 ans, ou j'ai lu et accepté la <%= link_to "politique de confidentialité", last_policy_path, :target => "_blank" %> avec mon tuteur légal.
+ J'ai au moins 16 ans, ou j'ai lu et accepté la <%= link_to "politique de confidentialité", last_privacypolicies_path, :target => "_blank" %> avec mon tuteur légal.
diff --git a/app/views/users/search_user.html.erb b/app/views/users/search.html.erb
similarity index 93%
rename from app/views/users/search_user.html.erb
rename to app/views/users/search.html.erb
index 29cef699..f44a3b6a 100644
--- a/app/views/users/search_user.html.erb
+++ b/app/views/users/search.html.erb
@@ -12,7 +12,7 @@
<%= render "tabs", t: 3 %>
-<%= form_tag search_user_path, :method => "get", :name => "research", :class => "mb-3" do %>
+<%= form_tag search_users_path, :method => "get", :name => "research", :class => "mb-3" do %>
Prénom et/ou nom :
diff --git a/config/routes.rb b/config/routes.rb
index ff136e81..ff83f62d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -3,9 +3,8 @@
# Sections
resources :sections, only: [:show, :edit, :update] do
resources :chapters, only: [:new, :create]
- resources :problems, only: [:new, :create]
+ resources :problems, only: [:index, :new, :create]
end
- get 'pb_sections/:id', to: 'sections#show_problems', as: :pb_sections
# Chapters
resources :chapters, only: [:show, :update, :edit, :destroy] do
@@ -17,11 +16,12 @@
put :order
put :read
end
+ collection do
+ get :stats
+ end
resources :theories, only: [:show, :new, :create]
resources :questions, only: [:show, :new, :create]
end
- match '/chapterstats', to: 'chapters#chapterstats', :via => [:get]
- resources :chaptercreations, only: [] # Must be added manually in the database!
# Prerequisites
resources :prerequisites, only: [:index, :create, :destroy]
@@ -45,7 +45,6 @@
patch :update_explanation
get :manage_items
end
-
resources :items, only: [:create]
end
@@ -74,10 +73,12 @@
post :add_virtualtest
get :manage_externalsolutions
end
-
- resources :submissions, only: [:create]
+ resources :submissions, only: [:create] do
+ collection do
+ post :create_intest
+ end
+ end
resources :externalsolutions, only: [:create]
- match '/create_intest', to: 'submissions#create_intest', :via => [:post]
end
resources :solvedproblems, only: [:index]
@@ -97,16 +98,16 @@
get :unreserve # only via JS
post :search_script # only via JS
end
-
+ collection do
+ get :all
+ get :allmy
+ get :allnew
+ get :allmynew
+ end
resources :corrections, only: [:create]
resources :suspicions, only: [:create]
resources :starproposals, only: [:create]
end
-
- match '/allsub', to: 'submissions#allsub', :via => [:get]
- match '/allmysub', to: 'submissions#allmysub', :via => [:get]
- match '/allnewsub', to: 'submissions#allnewsub', :via => [:get]
- match '/allmynewsub', to: 'submissions#allmynewsub', :via => [:get]
# External solutions
resources :externalsolutions, only: [:update, :destroy] do
@@ -141,7 +142,6 @@
patch :add_organizer
put :remove_organizer
end
-
resources :contestproblems, only: [:new, :create]
end
@@ -152,7 +152,6 @@
put :authorize_corrections
put :unauthorize_corrections
end
-
resources :contestsolutions, only: [:create]
end
@@ -174,7 +173,6 @@
put :follow
get :unfollow # Get because it should be doable via email link
end
-
resources :messages, only: [:create]
end
@@ -208,23 +206,25 @@
put :ban_temporarily
get :validate_name # only via JS
end
+ collection do
+ get :groups
+ get :correctors
+ get :followed
+ get :search
+ get :validate_names
+ end
end
- match '/leave_skin', to: 'users#leave_skin', :via => [:put]
- match '/accept_legal', to: 'users#accept_legal', :via => [:patch]
- match '/groups', to: 'users#groups', :via => [:get]
- match '/correctors', to: 'users#correctors', :via => [:get]
- match '/followed_users', to: 'users#followed_users', :via => [:get]
- match '/search_user', to: 'users#search_user', :via => [:get]
- match '/notifs', to: 'users#notifs', :via => [:get]
- match '/signup', to: 'users#new', :via => [:get]
- match '/activate', to: 'users#activate', :via => [:get]
- match '/forgot_password', to: 'users#forgot_password', :via => [:get]
- match '/password_forgotten', to: 'users#password_forgotten', :via => [:post]
- match '/validate_names', to: 'users#validate_names', :via => [:get]
- # Email subscriptions (subjects, discussions and contests)
- match '/set_follow_message', to: "users#set_follow_message", :via => [:put]
- match '/unset_follow_message', to: "users#unset_follow_message", :via => [:get] # Get because it should be doable via email link
+ # Paths relative to current user
+ put '/leave_skin', to: 'users#leave_skin'
+ patch '/accept_legal', to: 'users#accept_legal'
+ get '/notifs', to: 'users#notifs'
+ get '/signup', to: 'users#new'
+ get '/activate', to: 'users#activate'
+ get '/forgot_password', to: 'users#forgot_password'
+ post '/password_forgotten', to: 'users#password_forgotten'
+ put '/set_follow_message', to: "users#set_follow_message"
+ get '/unset_follow_message', to: "users#unset_follow_message" # Get because it should be doable via email link
# Privacy policies
resources :privacypolicies, only: [:index, :show, :new, :edit, :update, :destroy] do
@@ -233,8 +233,10 @@
get :edit_description
patch :update_description
end
+ collection do
+ get :last
+ end
end
- match '/last_policy', to: 'privacypolicies#last_policy', :via => [:get]
# Pictures
resources :pictures, only: [:index, :show, :new, :create, :destroy] do
@@ -273,15 +275,14 @@
end
end
- # Sessions
- resources :sessions, only: [:create, :destroy]
- match '/signout', to: 'sessions#destroy', via: :delete
+ # Sessions (singular resource, to call destroy without an id!)
+ resource :sessions, only: [:create, :destroy]
# Static pages
root to: 'static_pages#home'
- match '/about', to: 'static_pages#about', :via => [:get]
- match '/contact', to: 'static_pages#contact', :via => [:get]
- match '/stats', to: 'static_pages#stats', :via => [:get]
+ get '/about', to: 'static_pages#about'
+ get '/contact', to: 'static_pages#contact'
+ get '/stats', to: 'static_pages#stats'
# Redirections for important old page names
get '/frequentation', to: redirect('/stats') # sometimes used in forum
diff --git a/spec/controllers/chapters_controller_spec.rb b/spec/controllers/chapters_controller_spec.rb
index fe1d283a..64189479 100644
--- a/spec/controllers/chapters_controller_spec.rb
+++ b/spec/controllers/chapters_controller_spec.rb
@@ -27,7 +27,7 @@
it { expect(response).to have_controller_put_path_behavior('unmark_submission_prerequisite', online_chapter, :access_refused) }
it { expect(response).to have_controller_put_path_behavior('order', online_chapter, :access_refused) }
it { expect(response).to have_controller_put_path_behavior('read', online_chapter, :access_refused) }
- it { expect(response).to have_controller_get_static_path_behavior('chapterstats', :ok) }
+ it { expect(response).to have_controller_get_static_path_behavior('stats', :ok) }
it "redirects to new format for chapter type 0" do
get :show, params: {id: online_chapter.id, type: 0}
@@ -68,7 +68,7 @@
it { expect(response).to have_controller_put_path_behavior('order', online_chapter, :access_refused) }
it { expect(response).to have_controller_put_path_behavior('read', online_chapter, :ok) }
it { expect(response).to have_controller_put_path_behavior('read', offline_chapter, :access_refused) }
- it { expect(response).to have_controller_get_static_path_behavior('chapterstats', :ok) }
+ it { expect(response).to have_controller_get_static_path_behavior('stats', :ok) }
end
context "if the user is an admin (not a root)" do
@@ -87,7 +87,7 @@
it { expect(response).to have_controller_put_path_behavior('unmark_submission_prerequisite', online_chapter, :access_refused) }
it { expect(response).to have_controller_put_path_behavior('order', online_chapter, :ok) }
it { expect(response).to have_controller_put_path_behavior('read', online_chapter, :access_refused) }
- it { expect(response).to have_controller_get_static_path_behavior('chapterstats', :ok) }
+ it { expect(response).to have_controller_get_static_path_behavior('stats', :ok) }
end
context "if the user is a root" do
diff --git a/spec/requests/OLD/authentication_pages_spec.rb b/spec/requests/OLD/authentication_pages_spec.rb
index 3c856c88..9fc92b6e 100644
--- a/spec/requests/OLD/authentication_pages_spec.rb
+++ b/spec/requests/OLD/authentication_pages_spec.rb
@@ -27,7 +27,7 @@
expect(Capybara.current_session.driver.request.cookies.[]('remember_token')).to eq(user.remember_token)
expect(page).to have_link("Scores", href: users_path)
expect(page).to have_link("Compte", href: edit_user_path(user))
- expect(page).to have_link("Déconnexion", href: signout_path)
+ expect(page).to have_link("Déconnexion", href: sessions_path)
expect(page).to have_no_link("Connexion")
end
diff --git a/spec/requests/OLD/submission_pages_spec.rb b/spec/requests/OLD/submission_pages_spec.rb
index 4ebf73a2..896adeba 100644
--- a/spec/requests/OLD/submission_pages_spec.rb
+++ b/spec/requests/OLD/submission_pages_spec.rb
@@ -324,10 +324,10 @@
describe "bad corrector" do
before { sign_in bad_corrector }
- it { should have_link("0", href: allnewsub_path(:levels => 3)) } # 0 waiting submission of level 1, 2 (because cannot see it)
+ it { should have_link("0", href: allnew_submissions_path(:levels => 3)) } # 0 waiting submission of level 1, 2 (because cannot see it)
describe "visits submissions page" do
- before { visit allnewsub_path(:levels => 3) }
+ before { visit allnew_submissions_path(:levels => 3) }
it do
should have_selector("h1", text: "Soumissions")
should have_no_link(user.name, href: user_path(user))
@@ -345,10 +345,10 @@
describe "good corrector" do
before { sign_in good_corrector }
- it { should have_link("1", href: allnewsub_path(:levels => 3)) } # 1 waiting submission
+ it { should have_link("1", href: allnew_submissions_path(:levels => 3)) } # 1 waiting submission
describe "visits submissions page" do
- before { visit allnewsub_path(:levels => 3) }
+ before { visit allnew_submissions_path(:levels => 3) }
it do
should have_selector("h1", text: "Soumissions")
should have_link(user.name, href: user_path(user))
@@ -397,7 +397,7 @@
expect(waiting_submission.corrections.last.content).to eq(newcorrection)
expect(page).to have_selector("h3", text: "Soumission (correcte)")
expect(page).to have_selector("div", text: newcorrection)
- expect(page).to have_link("0", href: allnewsub_path(:levels => 3)) # no more waiting submission
+ expect(page).to have_link("0", href: allnew_submissions_path(:levels => 3)) # no more waiting submission
expect(page).to have_link("Marquer comme erronée")
expect(page).to have_no_link("Étoiler cette solution") # only for roots
expect(user.rating).to eq(rating_before + waiting_submission.problem.value)
@@ -501,7 +501,7 @@
expect(waiting_submission.notified_users.exists?(user.id)).to eq(true)
expect(page).to have_selector("h3", text: "Soumission (erronée)")
expect(page).to have_selector("div", text: newcorrection)
- expect(page).to have_link("0", href: allnewsub_path(:levels => 3)) # no more waiting submission
+ expect(page).to have_link("0", href: allnew_submissions_path(:levels => 3)) # no more waiting submission
end
describe "and admin accepts it" do
@@ -601,13 +601,13 @@
sign_in good_corrector
end
it do
- should have_link("0", href: allnewsub_path(:levels => 3))
- should have_link("0", href: allnewsub_path(:levels => 28))
- should have_link("1", href: allmynewsub_path)
+ should have_link("0", href: allnew_submissions_path(:levels => 3))
+ should have_link("0", href: allnew_submissions_path(:levels => 28))
+ should have_link("1", href: allmynew_submissions_path)
end
describe "visits comments page" do
- before { visit allmynewsub_path }
+ before { visit allmynew_submissions_path }
it do
should have_selector("h1", text: "Commentaires")
should have_link(user.name, href: user_path(user))
diff --git a/spec/requests/OLD/user_pages_spec.rb b/spec/requests/OLD/user_pages_spec.rb
index 0aed652a..2555370c 100644
--- a/spec/requests/OLD/user_pages_spec.rb
+++ b/spec/requests/OLD/user_pages_spec.rb
@@ -215,7 +215,7 @@
fill_in "header_connect_password", with: new_password
click_button "header_connect_button"
end
- it { should have_link("Déconnexion", href: signout_path) }
+ it { should have_link("Déconnexion", href: sessions_path) }
end
end
end
@@ -288,7 +288,7 @@
specify do
expect(page).to have_selector("h1", text: "Actualités")
expect(page).to have_selector("div.alert.alert-success")
- expect(page).to have_link("Déconnexion", href: signout_path)
+ expect(page).to have_link("Déconnexion", href: sessions_path)
expect(zero_user.first_name).to eq(new_first_name)
expect(zero_user.last_name).to eq(new_last_name)
expect(zero_user.name).to eq(new_name)
@@ -357,7 +357,7 @@
let!(:lionel_pinot) { FactoryGirl.create(:user, first_name: "L'ionel", last_name: "Pinot", rating: 0) }
let!(:diesel_proust_inactive) { FactoryGirl.create(:user, first_name: "Diesel", last_name: "Proust", active: false) }
- before { visit search_user_path }
+ before { visit search_users_path }
it do
should have_field "search"
should have_button "Chercher"
@@ -392,11 +392,11 @@
should have_link(lionel_p.name, href: user_path(lionel_p))
should have_no_link(lionel_pinot.name, href: user_path(lionel_pinot)) # on page 2
should have_no_link(diesel_proust_inactive.name, href: user_path(diesel_proust_inactive))
- should have_link(href: search_user_path(:search => " el p ", :page => 2))
+ should have_link(href: search_users_path(:search => " el p ", :page => 2))
end
describe "and visits page 2" do
- before { visit search_user_path(:search => " el p ", :page => 2) }
+ before { visit search_users_path(:search => " el p ", :page => 2) }
it do
should have_no_selector("h4", text: "Administrateurs") # only on page 1
should have_no_link(marcel_proust.name, href: user_path(marcel_proust))
@@ -405,7 +405,7 @@
should have_no_link(lionel_p.name, href: user_path(lionel_p)) # on page 1
should have_link(lionel_pinot.name, href: user_path(lionel_pinot))
should have_no_link(diesel_proust_inactive.name, href: user_path(diesel_proust_inactive))
- should have_link(href: search_user_path(:search => " el p ", :page => 1))
+ should have_link(href: search_users_path(:search => " el p ", :page => 1))
end
end
end
@@ -514,7 +514,7 @@
describe "tries to visit wepion groups while not being in it" do
before do
zero_user.update(:wepion => false, :group => "")
- visit groups_path
+ visit groups_users_path
end
it { should have_content(error_access_refused) }
end
@@ -537,7 +537,7 @@
before do
zero_user.update(:wepion => true, :group => "A")
other_zero_user.update(:wepion => false, :group => "")
- visit groups_path
+ visit groups_users_path
end
it do
should have_selector("h1", text: "Groupes Wépion")
@@ -824,7 +824,7 @@
let!(:user2) { FactoryGirl.create(:user, first_name: "jeaN", last_name: "boulanger", valid_name: false) }
let!(:user3) { FactoryGirl.create(:user, first_name: "vIcToR", last_name: "de la Terre", valid_name: false) }
- before { visit validate_names_path }
+ before { visit validate_names_users_path }
it do
should have_selector("h1", text: "Valider")
should have_no_link(user0.name, href: user_path(user0))
diff --git a/spec/requests/OLD/virtualtest_pages_spec.rb b/spec/requests/OLD/virtualtest_pages_spec.rb
index 2217422e..9fe83703 100644
--- a/spec/requests/OLD/virtualtest_pages_spec.rb
+++ b/spec/requests/OLD/virtualtest_pages_spec.rb
@@ -206,7 +206,7 @@
end
describe "and tries to visit the problem section page" do
- before { visit pb_sections_path(section) }
+ before { visit section_problems_path(section) }
it { should have_no_link("Problème \##{problem.id}", href: problem_path(problem)) }
end
diff --git a/spec/requests/privacypolicy_pages_spec.rb b/spec/requests/privacypolicy_pages_spec.rb
index 47c23731..11b35885 100644
--- a/spec/requests/privacypolicy_pages_spec.rb
+++ b/spec/requests/privacypolicy_pages_spec.rb
@@ -16,11 +16,11 @@
describe "visitor" do
describe "visits root path" do
before { visit root_path }
- it { should have_link("Confidentialité", href: last_policy_path) }
+ it { should have_link("Confidentialité", href: last_privacypolicies_path) }
end
describe "tries to visit last policy" do
- before { visit last_policy_path }
+ before { visit last_privacypolicies_path }
it { should have_error_message("Le site n'a actuellement aucune politique de confidentalité.") }
end
end
@@ -92,7 +92,7 @@
end
describe "visits last policy" do
- before { visit last_policy_path }
+ before { visit last_privacypolicies_path }
it do
should have_selector("h1", text: "Politique de confidentialité")
should have_content(policy2.content)
@@ -115,7 +115,7 @@
before { sign_in root }
describe "visits last policy" do
- before { visit last_policy_path }
+ before { visit last_privacypolicies_path }
it do
should have_selector("h1", text: "Politique de confidentialité")
should have_content(policy2.content)
diff --git a/spec/requests/problem_pages_spec.rb b/spec/requests/problem_pages_spec.rb
index ed8ffe38..b759bf5f 100644
--- a/spec/requests/problem_pages_spec.rb
+++ b/spec/requests/problem_pages_spec.rb
@@ -30,7 +30,7 @@
describe "visitor" do
describe "visits problems of a section" do
- before { visit pb_sections_path(section) }
+ before { visit section_problems_path(section) }
it do
should have_selector("h1", text: section.name)
should have_selector("div", text: "Les problèmes ne sont accessibles qu'aux utilisateurs ayant un score d'au moins 200.")
@@ -42,7 +42,7 @@
before { sign_in user_with_rating_199 }
describe "visits problems of a section" do
- before { visit pb_sections_path(section) }
+ before { visit section_problems_path(section) }
it do
should have_selector("h1", text: section.name)
should have_selector("div", text: "Les problèmes ne sont accessibles qu'aux utilisateurs ayant un score d'au moins 200.")
@@ -54,7 +54,7 @@
before { sign_in user_with_rating_200 }
describe "visits problems of a section" do
- before { visit pb_sections_path(section) }
+ before { visit section_problems_path(section) }
it do
should have_selector("h1", text: section.name)
should have_no_selector("div", text: "Les problèmes ne sont accessibles qu'aux utilisateurs ayant un score d'au moins 200.")
@@ -105,7 +105,7 @@
end
describe "visits problems of a section" do
- before { visit pb_sections_path(section) }
+ before { visit section_problems_path(section) }
it do
should have_link("Problème ##{online_problem_with_prerequisite.number}", href: problem_path(online_problem_with_prerequisite, :auto => 1))
should have_selector("div", text: online_problem_with_prerequisite.statement)
@@ -116,7 +116,7 @@
describe "visits problems of a section while no new submissions are allowed" do
before do
Globalvariable.create(:key => "no_new_submission", :value => 1, :message => no_new_sub_message)
- visit pb_sections_path(section)
+ visit section_problems_path(section)
end
it do
should have_info_message(no_new_sub_message)
@@ -140,7 +140,7 @@
before { sign_in admin }
describe "visits problems of a section" do
- before { visit pb_sections_path(section) }
+ before { visit section_problems_path(section) }
it do
should have_selector("h1", text: section.name)
should have_no_selector("div", text: "Les problèmes ne sont accessibles qu'aux utilisateurs ayant un score d'au moins 200.")
diff --git a/spec/views/OLD/section_showpb_spec.rb b/spec/views/OLD/problem_index_spec.rb
similarity index 97%
rename from spec/views/OLD/section_showpb_spec.rb
rename to spec/views/OLD/problem_index_spec.rb
index 6948519e..c4a9d635 100644
--- a/spec/views/OLD/section_showpb_spec.rb
+++ b/spec/views/OLD/problem_index_spec.rb
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
require "spec_helper"
-describe "Page section/showpb" do
+describe "Page problems/index" do
subject { page }
@@ -29,7 +29,7 @@
end
describe "visitor" do
- before { visit pb_sections_path(section) }
+ before { visit section_problems_path(section) }
it do
should have_selector("h1", text: section.name)
should have_selector("div", text: "Les problèmes ne sont accessibles qu'aux utilisateurs ayant un score d'au moins 200.")
@@ -39,7 +39,7 @@
describe "user with rating 199" do
before do
sign_in user_with_rating_199
- visit pb_sections_path(section)
+ visit section_problems_path(section)
end
it do
should have_selector("h1", text: section.name)
@@ -51,7 +51,7 @@
before { sign_in user }
describe "having completed no chapter" do
- before { visit pb_sections_path(section) }
+ before { visit section_problems_path(section) }
it do
should have_selector("h1", text: section.name)
should have_no_selector("div", text: "Les problèmes ne sont accessibles qu'aux utilisateurs ayant un score d'au moins 200.")
@@ -87,7 +87,7 @@
describe "having completed first chapter" do
before do
user.chapters << chapter1
- visit pb_sections_path(section)
+ visit section_problems_path(section)
end
it do
should have_selector("h1", text: section.name)
@@ -124,7 +124,7 @@
describe "having completed second chapter" do
before do
user.chapters << chapter2
- visit pb_sections_path(section)
+ visit section_problems_path(section)
end
it do
should have_selector("h1", text: section.name)
@@ -162,7 +162,7 @@
before do
user.chapters << chapter1
user.chapters << chapter2
- visit pb_sections_path(section)
+ visit section_problems_path(section)
end
it do
should have_selector("h1", text: section.name)
@@ -201,7 +201,7 @@
user.chapters << chapter1
user.chapters << chapter2
Takentest.create(:user => user, :virtualtest => online_virtualtest, status: :in_progress)
- visit pb_sections_path(section)
+ visit section_problems_path(section)
end
it do
should have_selector("h1", text: section.name)
@@ -240,7 +240,7 @@
user.chapters << chapter1
user.chapters << chapter2
Takentest.create(:user => user, :virtualtest => online_virtualtest, status: :finished)
- visit pb_sections_path(section)
+ visit section_problems_path(section)
end
it do
should have_selector("h1", text: section.name)
@@ -290,7 +290,7 @@
user.chapters << chapter1
user.chapters << chapter2
Takentest.create(:user => user, :virtualtest => online_virtualtest, status: :finished)
- visit pb_sections_path(section)
+ visit section_problems_path(section)
end
it do
should have_selector("h1", text: section.name)
@@ -346,7 +346,7 @@
user.chapters << chapter1
user.chapters << chapter2
Takentest.create(:user => user, :virtualtest => online_virtualtest, status: :finished)
- visit pb_sections_path(section)
+ visit section_problems_path(section)
end
it do
should have_selector("h1", text: section.name)
@@ -390,7 +390,7 @@
describe "admin" do
before do
sign_in admin
- visit pb_sections_path(section)
+ visit section_problems_path(section)
end
it do
diff --git a/spec/views/chapters/chapterstats.html.erb_spec.rb b/spec/views/chapters/stats.html.erb_spec.rb
similarity index 96%
rename from spec/views/chapters/chapterstats.html.erb_spec.rb
rename to spec/views/chapters/stats.html.erb_spec.rb
index a939de10..1854d021 100644
--- a/spec/views/chapters/chapterstats.html.erb_spec.rb
+++ b/spec/views/chapters/stats.html.erb_spec.rb
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
require "spec_helper"
-describe "chapters/chapterstats.html.erb", type: :view, chapter: true do
+describe "chapters/stats.html.erb", type: :view, chapter: true do
let(:admin) { FactoryGirl.create(:admin) }
let(:user) { FactoryGirl.create(:user) }
@@ -26,7 +26,7 @@
end
it "renders the statistics correctly" do
- render template: "chapters/chapterstats"
+ render template: "chapters/stats"
expect(rendered).to have_selector("h3", text: section.name)
expect(rendered).to have_selector("th", text: "Ex. 1")
expect(rendered).to have_selector("th", text: "Ex. 2")
@@ -49,7 +49,7 @@
end
it "renders the statistics correctly" do
- render template: "chapters/chapterstats"
+ render template: "chapters/stats"
expect(rendered).to have_selector("h3", text: section.name)
expect(rendered).to have_selector("th", text: "Ex. 1")
expect(rendered).to have_selector("th", text: "Ex. 2")
@@ -72,7 +72,7 @@
end
it "renders the statistics correctly" do
- render template: "chapters/chapterstats"
+ render template: "chapters/stats"
expect(rendered).to have_selector("h3", text: section.name)
expect(rendered).to have_selector("th", text: "Ex. 1")
expect(rendered).to have_selector("th", text: "Ex. 2")
@@ -93,7 +93,7 @@
context "if the user is not signed in" do
it "renders the menu correctly" do
- render template: "chapters/chapterstats"
+ render template: "chapters/stats"
expect(rendered).to have_selector("h3", text: section.name)
expect(rendered).to have_selector("th", text: "Ex. 1")
expect(rendered).to have_selector("th", text: "Ex. 2")
diff --git a/spec/views/layouts/_header.html.erb_spec.rb b/spec/views/layouts/_header.html.erb_spec.rb
index ddfd282c..b8fb1b42 100644
--- a/spec/views/layouts/_header.html.erb_spec.rb
+++ b/spec/views/layouts/_header.html.erb_spec.rb
@@ -15,9 +15,9 @@
render partial: "layouts/header"
expect(rendered).to have_link("Mathraining", href: root_path)
- expect(rendered).to have_no_link(href: allnewsub_path(:levels => 3))
- expect(rendered).to have_no_link(href: allnewsub_path(:levels => 28))
- expect(rendered).to have_no_link(href: allmynewsub_path)
+ expect(rendered).to have_no_link(href: allnew_submissions_path(:levels => 3))
+ expect(rendered).to have_no_link(href: allnew_submissions_path(:levels => 28))
+ expect(rendered).to have_no_link(href: allmynew_submissions_path)
expect(rendered).to have_no_link(href: starproposals_path)
expect(rendered).to have_no_link(href: suspicions_path)
expect(rendered).to have_no_link(href: notifs_path)
@@ -28,8 +28,8 @@
expect(rendered).to have_no_link("Modifier la structure")
expect(rendered).to have_link("Problèmes")
- expect(rendered).to have_no_link(section_fondation.name, href: pb_sections_path(section_fondation))
- expect(rendered).to have_link(section.name, href: pb_sections_path(section))
+ expect(rendered).to have_no_link(section_fondation.name, href: section_problems_path(section_fondation))
+ expect(rendered).to have_link(section.name, href: section_problems_path(section))
expect(rendered).to have_link("Tests virtuels", href: virtualtests_path)
expect(rendered).to have_link("Concours", href: contests_path)
@@ -53,9 +53,9 @@
render partial: "layouts/header"
expect(rendered).to have_link("Mathraining", href: root_path)
- expect(rendered).to have_no_link(href: allnewsub_path(:levels => 3))
- expect(rendered).to have_no_link(href: allnewsub_path(:levels => 28))
- expect(rendered).to have_no_link(href: allmynewsub_path)
+ expect(rendered).to have_no_link(href: allnew_submissions_path(:levels => 3))
+ expect(rendered).to have_no_link(href: allnew_submissions_path(:levels => 28))
+ expect(rendered).to have_no_link(href: allmynew_submissions_path)
expect(rendered).to have_no_link(href: starproposals_path)
expect(rendered).to have_no_link(href: suspicions_path)
expect(rendered).to have_no_link(href: notifs_path)
@@ -66,8 +66,8 @@
expect(rendered).to have_no_link("Modifier la structure")
expect(rendered).to have_link("Problèmes")
- expect(rendered).to have_no_link(section_fondation.name, href: pb_sections_path(section_fondation))
- expect(rendered).to have_link(section.name, href: pb_sections_path(section))
+ expect(rendered).to have_no_link(section_fondation.name, href: section_problems_path(section_fondation))
+ expect(rendered).to have_link(section.name, href: section_problems_path(section))
expect(rendered).to have_link("Tests virtuels", href: virtualtests_path)
expect(rendered).to have_link("Concours", href: contests_path)
@@ -79,11 +79,11 @@
expect(rendered).to have_link(user.fullname)
expect(rendered).to have_link("Profil", href: user_path(user))
expect(rendered).to have_link("Compte", href: edit_user_path(user))
- expect(rendered).to have_no_link("Groupes Wépion", href: groups_path)
+ expect(rendered).to have_no_link("Groupes Wépion", href: groups_users_path)
expect(rendered).to have_link("Messages", href: new_discussion_path)
expect(rendered).to have_no_link("Pièces jointes", href: myfiles_path)
- expect(rendered).to have_no_link(href: validate_names_path)
- expect(rendered).to have_link("Déconnexion", href: signout_path)
+ expect(rendered).to have_no_link(href: validate_names_users_path)
+ expect(rendered).to have_link("Déconnexion", href: sessions_path)
end
context "and has some notifications" do
@@ -108,7 +108,7 @@
it "renders the link to Wépion groups" do
render partial: "layouts/header"
- expect(rendered).to have_link("Groupes Wépion", href: groups_path)
+ expect(rendered).to have_link("Groupes Wépion", href: groups_users_path)
end
end
@@ -147,9 +147,9 @@
it "renders the buttons for correctors" do
render partial: "layouts/header"
- expect(rendered).to have_link(href: allnewsub_path(:levels => 3))
- expect(rendered).to have_link(href: allnewsub_path(:levels => 28))
- expect(rendered).to have_link("0", href: allmynewsub_path)
+ expect(rendered).to have_link(href: allnew_submissions_path(:levels => 3))
+ expect(rendered).to have_link(href: allnew_submissions_path(:levels => 28))
+ expect(rendered).to have_link("0", href: allmynew_submissions_path)
end
context "and has new comments to read" do
@@ -157,7 +157,7 @@
it "renders the number of comments to read correctly" do
render partial: "layouts/header"
- expect(rendered).to have_link("1", href: allmynewsub_path)
+ expect(rendered).to have_link("1", href: allmynew_submissions_path)
end
end
end
@@ -172,9 +172,9 @@
render partial: "layouts/header"
expect(rendered).to have_link("Mathraining", href: root_path)
- expect(rendered).to have_link(href: allnewsub_path(:levels => 3))
- expect(rendered).to have_link(href: allnewsub_path(:levels => 28))
- expect(rendered).to have_link("0", href: allmynewsub_path)
+ expect(rendered).to have_link(href: allnew_submissions_path(:levels => 3))
+ expect(rendered).to have_link(href: allnew_submissions_path(:levels => 28))
+ expect(rendered).to have_link("0", href: allmynew_submissions_path)
expect(rendered).to have_no_link(href: starproposals_path)
expect(rendered).to have_no_link(href: suspicions_path)
expect(rendered).to have_no_link(href: notifs_path)
@@ -185,8 +185,8 @@
expect(rendered).to have_link("Modifier la structure")
expect(rendered).to have_link("Problèmes")
- expect(rendered).to have_no_link(section_fondation.name, href: pb_sections_path(section_fondation))
- expect(rendered).to have_link(section.name, href: pb_sections_path(section))
+ expect(rendered).to have_no_link(section_fondation.name, href: section_problems_path(section_fondation))
+ expect(rendered).to have_link(section.name, href: section_problems_path(section))
expect(rendered).to have_link("Tests virtuels", href: virtualtests_path)
expect(rendered).to have_link("Concours", href: contests_path)
@@ -198,11 +198,11 @@
expect(rendered).to have_link(admin.fullname)
expect(rendered).to have_link("Profil", href: user_path(admin))
expect(rendered).to have_link("Compte", href: edit_user_path(admin))
- expect(rendered).to have_link("Groupes Wépion", href: groups_path)
+ expect(rendered).to have_link("Groupes Wépion", href: groups_users_path)
expect(rendered).to have_link("Messages", href: new_discussion_path)
expect(rendered).to have_no_link("Pièces jointes", href: myfiles_path)
- expect(rendered).to have_no_link(href: validate_names_path)
- expect(rendered).to have_link("Déconnexion", href: signout_path)
+ expect(rendered).to have_no_link(href: validate_names_users_path)
+ expect(rendered).to have_link("Déconnexion", href: sessions_path)
end
end
@@ -215,9 +215,9 @@
render partial: "layouts/header"
expect(rendered).to have_link("Mathraining", href: root_path)
- expect(rendered).to have_link(href: allnewsub_path(:levels => 3))
- expect(rendered).to have_link(href: allnewsub_path(:levels => 28))
- expect(rendered).to have_link("0", href: allmynewsub_path)
+ expect(rendered).to have_link(href: allnew_submissions_path(:levels => 3))
+ expect(rendered).to have_link(href: allnew_submissions_path(:levels => 28))
+ expect(rendered).to have_link("0", href: allmynew_submissions_path)
expect(rendered).to have_no_link(href: starproposals_path)
expect(rendered).to have_no_link(href: suspicions_path)
expect(rendered).to have_no_link(href: notifs_path)
@@ -228,8 +228,8 @@
expect(rendered).to have_link("Modifier la structure")
expect(rendered).to have_link("Problèmes")
- expect(rendered).to have_no_link(section_fondation.name, href: pb_sections_path(section_fondation))
- expect(rendered).to have_link(section.name, href: pb_sections_path(section))
+ expect(rendered).to have_no_link(section_fondation.name, href: section_problems_path(section_fondation))
+ expect(rendered).to have_link(section.name, href: section_problems_path(section))
expect(rendered).to have_link("Tests virtuels", href: virtualtests_path)
expect(rendered).to have_link("Concours", href: contests_path)
@@ -241,11 +241,11 @@
expect(rendered).to have_link(root.fullname)
expect(rendered).to have_link("Profil", href: user_path(root))
expect(rendered).to have_link("Compte", href: edit_user_path(root))
- expect(rendered).to have_link("Groupes Wépion", href: groups_path)
+ expect(rendered).to have_link("Groupes Wépion", href: groups_users_path)
expect(rendered).to have_link("Messages", href: new_discussion_path)
expect(rendered).to have_link("Pièces jointes", href: myfiles_path)
- expect(rendered).to have_link("Valider 0 noms", href: validate_names_path)
- expect(rendered).to have_link("Déconnexion", href: signout_path)
+ expect(rendered).to have_link("Valider 0 noms", href: validate_names_users_path)
+ expect(rendered).to have_link("Déconnexion", href: sessions_path)
end
context "and there is a suspicion" do
@@ -271,7 +271,7 @@
it "renders the number of user names to validate" do
render partial: "layouts/header"
- expect(rendered).to have_link("Valider 1 noms", href: validate_names_path)
+ expect(rendered).to have_link("Valider 1 noms", href: validate_names_users_path)
end
end
end