add jetons particulier index page

Co-authored-by: François VANTOMME <akarzim@gmail.com>
This commit is contained in:
simon lehericey 2021-09-15 11:10:28 +02:00
parent 87cb16093f
commit 4c0dd43055
4 changed files with 53 additions and 0 deletions

View file

@ -0,0 +1,8 @@
module NewAdministrateur
class JetonParticulierController < AdministrateurController
before_action :retrieve_procedure
def api_particulier
end
end
end

View file

@ -0,0 +1,20 @@
= render partial: 'new_administrateur/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Jeton Particulier'] }
.container
.flex
= link_to admin_procedure_api_particulier_jeton_path, class: 'card-admin' do
- if @procedure.api_particulier_token.blank?
%div
%span.icon.clock
%p.card-admin-status-todo À définir
- else
%div
%span.icon.accept
%p.card-admin-status-accept Déjà rempli
%div
%p.card-admin-title
Jeton API particulier
%p.button Modifier

View file

@ -397,6 +397,12 @@ Rails.application.routes.draw do
put :experts_require_administrateur_invitation put :experts_require_administrateur_invitation
end end
get :api_particulier, controller: 'jeton_particulier'
resource 'api_particulier', only: [] do
resource 'jeton', only: [:show]
end
put 'clone' put 'clone'
put 'archive' put 'archive'
get 'publication' => 'procedures#publication', as: :publication get 'publication' => 'procedures#publication', as: :publication

View file

@ -0,0 +1,19 @@
describe NewAdministrateur::JetonParticulierController, type: :controller do
let(:admin) { create(:administrateur) }
let(:procedure) { create(:procedure, administrateur: admin) }
before do
sign_in(admin.user)
end
describe "GET #api_particulier" do
let(:procedure) { create :procedure, :with_service, administrateur: admin }
render_views
subject { get :api_particulier, params: { procedure_id: procedure.id } }
it { is_expected.to have_http_status(:success) }
it { expect(subject.body).to have_content('Jeton API particulier') }
end
end