rename route

This commit is contained in:
Tanguy PATTE 2015-08-20 14:12:42 +02:00
parent 4f5587cb66
commit 4d728962d0
6 changed files with 10 additions and 10 deletions

View file

@ -43,8 +43,8 @@ Rails.application.routes.draw do
end
namespace :admin do
get '/dossier/:dossier_id' => 'dossier#show'
get '/dossier' => 'dossier#index'
get '/dossiers/:dossier_id' => 'dossier#show'
get '/dossiers' => 'dossier#index'
end
# The priority is based upon order of creation: first created -> highest priority.

View file

@ -38,7 +38,7 @@ RSpec.describe Admin::DossierController, type: :controller do
it 'le numéro de dossier est correct' do
get :index, :dossier_id => dossier_id
expect(response).to redirect_to("/admin/dossier/#{dossier_id}")
expect(response).to redirect_to("/admin/dossiers/#{dossier_id}")
end
it 'il n\' y a pas de numéro de dossier' do

View file

@ -15,9 +15,9 @@ describe CommentairesController, type: :controller do
end
it 'depuis la page admin' do
request.env["HTTP_REFERER"] = "/admin/dossier"
request.env["HTTP_REFERER"] = "/admin/dossiers"
post :create, :dossier_id => dossier_id, :email_commentaire => email_commentaire, :texte_commentaire => texte_commentaire
expect(response).to redirect_to("/admin/dossier/#{dossier_id}")
expect(response).to redirect_to("/admin/dossiers/#{dossier_id}")
end
end
end

View file

@ -12,7 +12,7 @@ feature '_Commentaires_Flux Admin/Dossier#Show Page' do
before do
dossier.build_default_pieces_jointes
login_admin
visit "/admin/dossier/#{dossier_id}"
visit "/admin/dossiers/#{dossier_id}"
end
context 'Affichage du flux de commentaire' do

View file

@ -7,7 +7,7 @@ feature 'Admin/Dossier#Show Page' do
before do
dossier.build_default_pieces_jointes
login_admin
visit "/admin/dossier/#{dossier_id}"
visit "/admin/dossiers/#{dossier_id}"
end
context 'sur la page admin du dossier' do
@ -68,7 +68,7 @@ feature 'Admin/Dossier#Show Page' do
piece_jointe = dossier.pieces_jointes.where(type_piece_jointe_id: 388).first
piece_jointe.content = content
piece_jointe.save!
visit "/admin/dossier/#{dossier_id}"
visit "/admin/dossiers/#{dossier_id}"
end
scenario 'la ligne de la pièce jointe est présente' do

View file

@ -77,8 +77,8 @@ feature 'Start#Index Page' do
end
context 'dans la section admninistration' do
scenario 'le formulaire envoie vers /admin/dossier en #GET' do
expect(page).to have_selector("form[action='/admin/dossier'][method=get]")
scenario 'le formulaire envoie vers /admin/dossiers en #GET' do
expect(page).to have_selector("form[action='/admin/dossiers'][method=get]")
end
scenario ' le champs "Identifiant" n\'est pas présent' do