remove unnecessary retransition methods
This commit is contained in:
parent
2f82dd9a3d
commit
f5d3818e3c
3 changed files with 3 additions and 7 deletions
|
@ -109,7 +109,7 @@ module Gestionnaires
|
||||||
if dossier.en_instruction?
|
if dossier.en_instruction?
|
||||||
flash.notice = 'Le dossier est déjà en instruction.'
|
flash.notice = 'Le dossier est déjà en instruction.'
|
||||||
else
|
else
|
||||||
if dossier.accepte? && !administration_signed_in?
|
if dossier.accepte?
|
||||||
flash.notice = 'Il n’est pas possible de repasser un dossier accepté en instruction.'
|
flash.notice = 'Il n’est pas possible de repasser un dossier accepté en instruction.'
|
||||||
else
|
else
|
||||||
flash.notice = "Le dossier #{dossier.id} a été repassé en instruction."
|
flash.notice = "Le dossier #{dossier.id} a été repassé en instruction."
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
class Dossier < ApplicationRecord
|
class Dossier < ApplicationRecord
|
||||||
include DossierFilteringConcern
|
include DossierFilteringConcern
|
||||||
include Devise::Controllers::Helpers
|
|
||||||
|
|
||||||
enum state: {
|
enum state: {
|
||||||
brouillon: 'brouillon',
|
brouillon: 'brouillon',
|
||||||
|
@ -230,9 +229,6 @@ class Dossier < ApplicationRecord
|
||||||
!procedure.archivee? && brouillon?
|
!procedure.archivee? && brouillon?
|
||||||
end
|
end
|
||||||
|
|
||||||
def can_retransition_to_en_instruction?
|
|
||||||
end
|
|
||||||
|
|
||||||
def can_be_updated_by_user?
|
def can_be_updated_by_user?
|
||||||
brouillon? || en_construction?
|
brouillon? || en_construction?
|
||||||
end
|
end
|
||||||
|
|
|
@ -193,8 +193,8 @@ describe Gestionnaires::DossiersController, type: :controller do
|
||||||
end
|
end
|
||||||
context 'as superadmin' do
|
context 'as superadmin' do
|
||||||
let (:current_user) { administration }
|
let (:current_user) { administration }
|
||||||
it 'it is possible to go back to en_instruction' do
|
it 'it is not possible to go back to en_instruction' do
|
||||||
expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_instruction))
|
expect(dossier.reload.state).to eq(Dossier.states.fetch(:accepte))
|
||||||
expect(response).to have_http_status(:ok)
|
expect(response).to have_http_status(:ok)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue