Procedure: remove now duplicate organisation and direction
This commit is contained in:
parent
39bb56d1d9
commit
928227a610
7 changed files with 7 additions and 8 deletions
|
@ -46,7 +46,6 @@ class Procedure < ApplicationRecord
|
||||||
|
|
||||||
validates :libelle, presence: true, allow_blank: false, allow_nil: false
|
validates :libelle, presence: true, allow_blank: false, allow_nil: false
|
||||||
validates :description, presence: true, allow_blank: false, allow_nil: false
|
validates :description, presence: true, allow_blank: false, allow_nil: false
|
||||||
validates :organisation, presence: true, allow_blank: false, allow_nil: false
|
|
||||||
|
|
||||||
# Warning: dossier after_save build_default_champs must be removed
|
# Warning: dossier after_save build_default_champs must be removed
|
||||||
# to save a dossier created from this method
|
# to save a dossier created from this method
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.alert.alert-info
|
.alert.alert-info
|
||||||
Cette procédure est publiée, certains éléments de la description ne sont plus modifiables
|
Cette procédure est publiée, certains éléments de la description ne sont plus modifiables
|
||||||
|
|
||||||
- { libelle: 'Libellé*', description: 'Description*', organisation: 'Organisme*', direction: 'Direction', lien_site_web: 'Lien site internet', web_hook_url: 'Lien de rappel HTTP' }.each do |key, value|
|
- { libelle: 'Libellé*', description: 'Description*', lien_site_web: 'Lien site internet', web_hook_url: 'Lien de rappel HTTP' }.each do |key, value|
|
||||||
- if key != :web_hook_url || Flipflop.web_hook?
|
- if key != :web_hook_url || Flipflop.web_hook?
|
||||||
.form-group
|
.form-group
|
||||||
%h4
|
%h4
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AllowProcedureOrganismeToBeNull < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
change_column_null :procedures, :organisation, true
|
||||||
|
end
|
||||||
|
end
|
|
@ -441,7 +441,7 @@ ActiveRecord::Schema.define(version: 2018_05_15_135415) do
|
||||||
create_table "procedures", id: :serial, force: :cascade do |t|
|
create_table "procedures", id: :serial, force: :cascade do |t|
|
||||||
t.string "libelle"
|
t.string "libelle"
|
||||||
t.string "description"
|
t.string "description"
|
||||||
t.string "organisation", null: false
|
t.string "organisation"
|
||||||
t.string "direction"
|
t.string "direction"
|
||||||
t.string "lien_demarche"
|
t.string "lien_demarche"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
|
|
|
@ -14,7 +14,6 @@ feature 'As an administrateur I wanna clone a procedure', js: true do
|
||||||
page.find_by_id('from-scratch').click
|
page.find_by_id('from-scratch').click
|
||||||
fill_in 'procedure_libelle', with: 'libelle de la procedure'
|
fill_in 'procedure_libelle', with: 'libelle de la procedure'
|
||||||
page.execute_script("$('#procedure_description').val('description de la procedure')")
|
page.execute_script("$('#procedure_description').val('description de la procedure')")
|
||||||
fill_in 'procedure_organisation', with: 'organisme de la procedure'
|
|
||||||
page.find_by_id('save-procedure').click
|
page.find_by_id('save-procedure').click
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,6 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
|
||||||
page.find_by_id('flash_message').visible?
|
page.find_by_id('flash_message').visible?
|
||||||
fill_in 'procedure_libelle', with: 'libelle de la procedure'
|
fill_in 'procedure_libelle', with: 'libelle de la procedure'
|
||||||
page.execute_script("$('#procedure_description').val('description de la procedure')")
|
page.execute_script("$('#procedure_description').val('description de la procedure')")
|
||||||
fill_in 'procedure_organisation', with: 'organisme de la procedure'
|
|
||||||
page.find_by_id('save-procedure').click
|
page.find_by_id('save-procedure').click
|
||||||
expect(page).to have_current_path(admin_procedure_types_de_champ_path(Procedure.first.id.to_s))
|
expect(page).to have_current_path(admin_procedure_types_de_champ_path(Procedure.first.id.to_s))
|
||||||
end
|
end
|
||||||
|
@ -51,7 +50,6 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
|
||||||
page.find_by_id('from-scratch').click
|
page.find_by_id('from-scratch').click
|
||||||
fill_in 'procedure_libelle', with: 'libelle de la procedure'
|
fill_in 'procedure_libelle', with: 'libelle de la procedure'
|
||||||
page.execute_script("$('#procedure_description').val('description de la procedure')")
|
page.execute_script("$('#procedure_description').val('description de la procedure')")
|
||||||
fill_in 'procedure_organisation', with: 'organisme de la procedure'
|
|
||||||
page.find_by_id('save-procedure').click
|
page.find_by_id('save-procedure').click
|
||||||
|
|
||||||
procedure = Procedure.last
|
procedure = Procedure.last
|
||||||
|
|
|
@ -171,8 +171,6 @@ describe Procedure do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'organisation' do
|
context 'organisation' do
|
||||||
it { is_expected.not_to allow_value(nil).for(:organisation) }
|
|
||||||
it { is_expected.not_to allow_value('').for(:organisation) }
|
|
||||||
it { is_expected.to allow_value('URRSAF').for(:organisation) }
|
it { is_expected.to allow_value('URRSAF').for(:organisation) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue