Procedure: remove now duplicate organisation and direction

This commit is contained in:
simon lehericey 2018-05-11 12:09:32 +02:00
parent 39bb56d1d9
commit 928227a610
7 changed files with 7 additions and 8 deletions

View file

@ -46,7 +46,6 @@ class Procedure < ApplicationRecord
validates :libelle, 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
# to save a dossier created from this method

View file

@ -2,7 +2,7 @@
.alert.alert-info
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?
.form-group
%h4

View file

@ -0,0 +1,5 @@
class AllowProcedureOrganismeToBeNull < ActiveRecord::Migration[5.2]
def change
change_column_null :procedures, :organisation, true
end
end

View file

@ -441,7 +441,7 @@ ActiveRecord::Schema.define(version: 2018_05_15_135415) do
create_table "procedures", id: :serial, force: :cascade do |t|
t.string "libelle"
t.string "description"
t.string "organisation", null: false
t.string "organisation"
t.string "direction"
t.string "lien_demarche"
t.datetime "created_at", null: false

View file

@ -14,7 +14,6 @@ feature 'As an administrateur I wanna clone a procedure', js: true do
page.find_by_id('from-scratch').click
fill_in 'procedure_libelle', with: 'libelle 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
end

View file

@ -39,7 +39,6 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
page.find_by_id('flash_message').visible?
fill_in 'procedure_libelle', with: 'libelle 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
expect(page).to have_current_path(admin_procedure_types_de_champ_path(Procedure.first.id.to_s))
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
fill_in 'procedure_libelle', with: 'libelle 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
procedure = Procedure.last

View file

@ -171,8 +171,6 @@ describe Procedure do
end
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) }
end
end