Fix service controller

This commit is contained in:
Paul Chavard 2019-09-17 11:38:48 +02:00
parent 8a691d534a
commit ff2b6ca3ea
2 changed files with 1 additions and 3 deletions

View file

@ -73,7 +73,7 @@ module NewAdministrateur
private private
def service_params def service_params
params.require(:service).permit(:nom, :organisme, :siret, :type_organisme, :email, :telephone, :horaires, :adresse) params.require(:service).permit(:nom, :organisme, :type_organisme, :email, :telephone, :horaires, :adresse)
end end
def service def service

View file

@ -14,7 +14,6 @@ describe NewAdministrateur::ServicesController, type: :controller do
service: { service: {
nom: 'super service', nom: 'super service',
organisme: 'organisme', organisme: 'organisme',
siret: '01234567891234',
type_organisme: 'association', type_organisme: 'association',
email: 'email@toto.com', email: 'email@toto.com',
telephone: '1234', telephone: '1234',
@ -29,7 +28,6 @@ describe NewAdministrateur::ServicesController, type: :controller do
it { expect(flash.notice).to eq('super service créé') } it { expect(flash.notice).to eq('super service créé') }
it { expect(Service.last.nom).to eq('super service') } it { expect(Service.last.nom).to eq('super service') }
it { expect(Service.last.organisme).to eq('organisme') } it { expect(Service.last.organisme).to eq('organisme') }
it { expect(Service.last.siret).to eq('01234567891234') }
it { expect(Service.last.type_organisme).to eq(Service.type_organismes.fetch(:association)) } it { expect(Service.last.type_organisme).to eq(Service.type_organismes.fetch(:association)) }
it { expect(Service.last.email).to eq('email@toto.com') } it { expect(Service.last.email).to eq('email@toto.com') }
it { expect(Service.last.telephone).to eq('1234') } it { expect(Service.last.telephone).to eq('1234') }