Bump development gems
- brakeman - rubocop - scss_lint
This commit is contained in:
parent
1030a4ae7d
commit
d6ad3fc3fd
42 changed files with 99 additions and 94 deletions
40
.rubocop.yml
40
.rubocop.yml
|
@ -24,6 +24,9 @@ Layout/AlignParameters:
|
|||
Enabled: true
|
||||
EnforcedStyle: with_fixed_indentation
|
||||
|
||||
Layout/BlockAlignment:
|
||||
Enabled: false
|
||||
|
||||
Layout/BlockEndNewline:
|
||||
Enabled: true
|
||||
|
||||
|
@ -37,6 +40,12 @@ Layout/ClosingParenthesisIndentation:
|
|||
Layout/CommentIndentation:
|
||||
Enabled: true
|
||||
|
||||
Layout/ConditionPosition:
|
||||
Enabled: false
|
||||
|
||||
Layout/DefEndAlignment:
|
||||
Enabled: false
|
||||
|
||||
Layout/DotPosition:
|
||||
Enabled: true
|
||||
|
||||
|
@ -73,6 +82,10 @@ Layout/EmptyLinesAroundMethodBody:
|
|||
Layout/EmptyLinesAroundModuleBody:
|
||||
Enabled: true
|
||||
|
||||
Layout/EndAlignment:
|
||||
Enabled: true
|
||||
EnforcedStyleAlignWith: variable
|
||||
|
||||
Layout/EndOfLine:
|
||||
Enabled: true
|
||||
EnforcedStyle: lf
|
||||
|
@ -248,21 +261,12 @@ Lint/AmbiguousRegexpLiteral:
|
|||
Lint/AssignmentInCondition:
|
||||
Enabled: false
|
||||
|
||||
Lint/BlockAlignment:
|
||||
Enabled: false
|
||||
|
||||
Lint/CircularArgumentReference:
|
||||
Enabled: false
|
||||
|
||||
Lint/ConditionPosition:
|
||||
Enabled: false
|
||||
|
||||
Lint/Debugger:
|
||||
Enabled: false
|
||||
|
||||
Lint/DefEndAlignment:
|
||||
Enabled: false
|
||||
|
||||
Lint/DeprecatedClassMethods:
|
||||
Enabled: false
|
||||
|
||||
|
@ -293,10 +297,6 @@ Lint/EmptyInterpolation:
|
|||
Lint/EmptyWhen:
|
||||
Enabled: false
|
||||
|
||||
Lint/EndAlignment:
|
||||
Enabled: true
|
||||
EnforcedStyleAlignWith: variable
|
||||
|
||||
Lint/EndInMethod:
|
||||
Enabled: false
|
||||
|
||||
|
@ -480,12 +480,18 @@ Naming/FileName:
|
|||
Naming/HeredocDelimiterNaming:
|
||||
Enabled: false
|
||||
|
||||
Naming/MemoizedInstanceVariableName:
|
||||
Enabled: false
|
||||
|
||||
Naming/MethodName:
|
||||
Enabled: false
|
||||
|
||||
Naming/PredicateName:
|
||||
Enabled: false
|
||||
|
||||
Naming/UncommunicativeMethodParamName:
|
||||
Enabled: false
|
||||
|
||||
Naming/VariableName:
|
||||
Enabled: false
|
||||
|
||||
|
@ -522,9 +528,6 @@ Performance/FixedSize:
|
|||
Performance/FlatMap:
|
||||
Enabled: true
|
||||
|
||||
Performance/HashEachMethods:
|
||||
Enabled: false
|
||||
|
||||
Performance/LstripRstrip:
|
||||
Enabled: true
|
||||
|
||||
|
@ -1080,7 +1083,10 @@ Style/TernaryParentheses:
|
|||
Style/TrailingCommaInArguments:
|
||||
Enabled: false
|
||||
|
||||
Style/TrailingCommaInLiteral:
|
||||
Style/TrailingCommaInArrayLiteral:
|
||||
Enabled: false
|
||||
|
||||
Style/TrailingCommaInHashLiteral:
|
||||
Enabled: false
|
||||
|
||||
Style/TrailingUnderscoreVariable:
|
||||
|
|
12
Gemfile.lock
12
Gemfile.lock
|
@ -115,7 +115,7 @@ GEM
|
|||
sass (>= 3.3.4)
|
||||
bootstrap-wysihtml5-rails (0.3.3.8)
|
||||
railties (>= 3.0)
|
||||
brakeman (4.1.1)
|
||||
brakeman (4.2.0)
|
||||
browser (2.5.3)
|
||||
builder (3.2.3)
|
||||
byebug (10.0.0)
|
||||
|
@ -527,7 +527,7 @@ GEM
|
|||
json
|
||||
orm_adapter (0.5.0)
|
||||
parallel (1.12.1)
|
||||
parser (2.5.0.1)
|
||||
parser (2.5.0.3)
|
||||
ast (~> 2.4.0)
|
||||
pdf-core (0.7.0)
|
||||
pg (0.19.0)
|
||||
|
@ -642,9 +642,9 @@ GEM
|
|||
rspec-support (3.7.1)
|
||||
rspec_junit_formatter (0.3.0)
|
||||
rspec-core (>= 2, < 4, != 2.12.0)
|
||||
rubocop (0.52.1)
|
||||
rubocop (0.53.0)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 2.4.0.2, < 3.0)
|
||||
parser (>= 2.5)
|
||||
powerpack (~> 0.1)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
|
@ -672,9 +672,9 @@ GEM
|
|||
scenic (1.4.1)
|
||||
activerecord (>= 4.0.0)
|
||||
railties (>= 4.0.0)
|
||||
scss_lint (0.56.0)
|
||||
scss_lint (0.57.0)
|
||||
rake (>= 0.9, < 13)
|
||||
sass (~> 3.5.3)
|
||||
sass (~> 3.5.5)
|
||||
securecompare (1.0.0)
|
||||
select2-rails (4.0.3)
|
||||
thor (~> 0.14)
|
||||
|
|
2
Rakefile
2
Rakefile
|
@ -1,7 +1,7 @@
|
|||
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
||||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
||||
|
||||
require File.expand_path('../config/application', __FILE__)
|
||||
require File.expand_path('config/application', __dir__)
|
||||
|
||||
Rails.application.load_tasks
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ class Admin::AttestationTemplatesController < AdminController
|
|||
def update
|
||||
attestation_template = @procedure.attestation_template
|
||||
|
||||
if attestation_template.update_attributes(activated_attestation_params)
|
||||
if attestation_template.update(activated_attestation_params)
|
||||
flash.notice = "L'attestation a bien été modifiée"
|
||||
else
|
||||
flash.alert = attestation_template.errors.full_messages.join('<br>')
|
||||
|
|
|
@ -11,7 +11,7 @@ class Admin::MailTemplatesController < AdminController
|
|||
|
||||
def update
|
||||
mail_template = find_mail_template_by_slug(params[:id])
|
||||
mail_template.update_attributes(update_params)
|
||||
mail_template.update(update_params)
|
||||
redirect_to admin_procedure_mail_templates_path
|
||||
end
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ class Admin::PiecesJustificativesController < AdminController
|
|||
end
|
||||
|
||||
def update
|
||||
if @procedure.update_attributes(update_params)
|
||||
if @procedure.update(update_params)
|
||||
flash.now.notice = 'Modifications sauvegardées'
|
||||
else
|
||||
flash.now.notice = 'Une erreur est survenue'
|
||||
|
|
|
@ -105,7 +105,7 @@ class Admin::ProceduresController < AdminController
|
|||
def update
|
||||
@procedure = current_administrateur.procedures.find(params[:id])
|
||||
|
||||
if !@procedure.update_attributes(procedure_params)
|
||||
if !@procedure.update(procedure_params)
|
||||
flash.now.alert = @procedure.errors.full_messages
|
||||
return render 'edit'
|
||||
end
|
||||
|
|
|
@ -15,7 +15,7 @@ class Admin::TypesDeChampController < AdminController
|
|||
end
|
||||
|
||||
def update
|
||||
@procedure.update_attributes(TypesDeChampService.create_update_procedure_params params)
|
||||
@procedure.update(TypesDeChampService.create_update_procedure_params params)
|
||||
create_facade
|
||||
flash.now.notice = 'Modifications sauvegardées'
|
||||
render 'show', format: :js
|
||||
|
|
|
@ -16,7 +16,7 @@ class Admin::TypesDeChampPrivateController < AdminController
|
|||
end
|
||||
|
||||
def update
|
||||
@procedure.update_attributes(TypesDeChampService.create_update_procedure_params params, true)
|
||||
@procedure.update(TypesDeChampService.create_update_procedure_params params, true)
|
||||
create_facade
|
||||
flash.now.notice = 'Modifications sauvegardées'
|
||||
render 'admin/types_de_champ/show', format: :js
|
||||
|
|
|
@ -32,7 +32,7 @@ module NewGestionnaire
|
|||
end
|
||||
|
||||
def update
|
||||
avis.update_attributes(avis_params)
|
||||
avis.update(avis_params)
|
||||
flash.notice = 'Votre réponse est enregistrée.'
|
||||
redirect_to instruction_gestionnaire_avis_path(avis)
|
||||
end
|
||||
|
|
|
@ -57,13 +57,13 @@ module NewGestionnaire
|
|||
end
|
||||
|
||||
def archive
|
||||
dossier.update_attributes(archived: true)
|
||||
dossier.update(archived: true)
|
||||
current_gestionnaire.unfollow(dossier)
|
||||
redirect_back(fallback_location: gestionnaire_procedures_url)
|
||||
end
|
||||
|
||||
def unarchive
|
||||
dossier.update_attributes(archived: false)
|
||||
dossier.update(archived: false)
|
||||
redirect_back(fallback_location: gestionnaire_procedures_url)
|
||||
end
|
||||
|
||||
|
@ -166,7 +166,7 @@ module NewGestionnaire
|
|||
def update_annotations
|
||||
dossier = current_gestionnaire.dossiers.includes(champs_private: :type_de_champ).find(params[:dossier_id])
|
||||
# FIXME: add attachements validation, cf. Champ#piece_justificative_file_errors
|
||||
dossier.update_attributes(champs_private_params)
|
||||
dossier.update(champs_private_params)
|
||||
redirect_to annotations_privees_gestionnaire_dossier_path(procedure, dossier)
|
||||
end
|
||||
|
||||
|
|
|
@ -109,11 +109,11 @@ module NewGestionnaire
|
|||
c.to_json
|
||||
end
|
||||
|
||||
procedure_presentation.update_attributes(displayed_fields: fields)
|
||||
procedure_presentation.update(displayed_fields: fields)
|
||||
|
||||
current_sort = procedure_presentation.sort
|
||||
if !values.include?("#{current_sort['table']}/#{current_sort['column']}")
|
||||
procedure_presentation.update_attributes(sort: Procedure.default_sort)
|
||||
procedure_presentation.update(sort: Procedure.default_sort)
|
||||
end
|
||||
|
||||
redirect_back(fallback_location: gestionnaire_procedure_url(procedure))
|
||||
|
@ -136,7 +136,7 @@ module NewGestionnaire
|
|||
'order' => order
|
||||
}.to_json
|
||||
|
||||
procedure_presentation.update_attributes(sort: sort)
|
||||
procedure_presentation.update(sort: sort)
|
||||
|
||||
redirect_back(fallback_location: gestionnaire_procedure_url(procedure))
|
||||
end
|
||||
|
@ -154,7 +154,7 @@ module NewGestionnaire
|
|||
'value' => params[:value]
|
||||
}
|
||||
|
||||
procedure_presentation.update_attributes(filters: filters.to_json)
|
||||
procedure_presentation.update(filters: filters.to_json)
|
||||
end
|
||||
|
||||
redirect_back(fallback_location: gestionnaire_procedure_url(procedure))
|
||||
|
@ -168,7 +168,7 @@ module NewGestionnaire
|
|||
|
||||
filters[statut] = filters[statut] - [filter_to_remove]
|
||||
|
||||
procedure_presentation.update_attributes(filters: filters.to_json)
|
||||
procedure_presentation.update(filters: filters.to_json)
|
||||
|
||||
redirect_back(fallback_location: gestionnaire_procedure_url(procedure))
|
||||
end
|
||||
|
@ -245,7 +245,6 @@ module NewGestionnaire
|
|||
.includes(filter['table'])
|
||||
.where("#{filter['table'].pluralize}.#{filter['column']} LIKE ?", "%#{filter['value']}%")
|
||||
end
|
||||
|
||||
end.pluck(:id)
|
||||
end.reduce(:&)
|
||||
end
|
||||
|
|
|
@ -22,7 +22,7 @@ class Users::CarteController < UsersController
|
|||
ModuleApiCartoService.save_cadastre! dossier, params[:json_latlngs]
|
||||
end
|
||||
|
||||
dossier.update_attributes(json_latlngs: params[:json_latlngs])
|
||||
dossier.update(json_latlngs: params[:json_latlngs])
|
||||
|
||||
redirect_to modifier_dossier_path(dossier)
|
||||
end
|
||||
|
|
|
@ -156,7 +156,7 @@ class Users::DossiersController < UsersController
|
|||
flash.alert = individual_errors
|
||||
redirect_to users_dossier_path(id: @facade.dossier.id)
|
||||
else
|
||||
if !Dossier.find(@facade.dossier.id).update_attributes update_params_with_formatted_birthdate
|
||||
if !Dossier.find(@facade.dossier.id).update update_params_with_formatted_birthdate
|
||||
flash.alert = @facade.dossier.errors.full_messages
|
||||
|
||||
return redirect_to users_dossier_path(id: @facade.dossier.id)
|
||||
|
@ -259,7 +259,7 @@ class Users::DossiersController < UsersController
|
|||
end
|
||||
|
||||
def update_current_user_siret! siret
|
||||
current_user.update_attributes(siret: siret)
|
||||
current_user.update(siret: siret)
|
||||
end
|
||||
|
||||
def facade id = params[:id]
|
||||
|
|
|
@ -20,7 +20,7 @@ class Users::SessionsController < Sessions::SessionsController
|
|||
try_to_authenticate(Administrateur, remember_me)
|
||||
|
||||
if user_signed_in?
|
||||
current_user.update_attributes(loged_in_with_france_connect: '')
|
||||
current_user.update(loged_in_with_france_connect: '')
|
||||
end
|
||||
|
||||
if user_signed_in?
|
||||
|
@ -44,7 +44,7 @@ class Users::SessionsController < Sessions::SessionsController
|
|||
|
||||
if user_signed_in?
|
||||
connected_with_france_connect = current_user.loged_in_with_france_connect
|
||||
current_user.update_attributes(loged_in_with_france_connect: '')
|
||||
current_user.update(loged_in_with_france_connect: '')
|
||||
|
||||
sign_out :user
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class Administrateur < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def renew_api_token
|
||||
update_attributes(api_token: generate_api_token)
|
||||
update(api_token: generate_api_token)
|
||||
end
|
||||
|
||||
def registration_state
|
||||
|
|
|
@ -42,7 +42,7 @@ class Procedure < ActiveRecord::Base
|
|||
|
||||
def hide!
|
||||
now = DateTime.now
|
||||
self.update_attributes(hidden_at: now)
|
||||
self.update(hidden_at: now)
|
||||
self.dossiers.update_all(hidden_at: now)
|
||||
end
|
||||
|
||||
|
@ -89,8 +89,8 @@ class Procedure < ActiveRecord::Base
|
|||
|
||||
false
|
||||
else
|
||||
list[index_of_first_element].update_attributes(order_place: index_of_first_element + 1)
|
||||
list[index_of_first_element + 1].update_attributes(order_place: index_of_first_element)
|
||||
list[index_of_first_element].update(order_place: index_of_first_element + 1)
|
||||
list[index_of_first_element + 1].update(order_place: index_of_first_element)
|
||||
|
||||
true
|
||||
end
|
||||
|
@ -129,7 +129,7 @@ class Procedure < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def publish!(path)
|
||||
self.update_attributes!({ published_at: Time.now, archived_at: nil })
|
||||
self.update!({ published_at: Time.now, archived_at: nil })
|
||||
ProcedurePath.create!(path: path, procedure: self, administrateur: self.administrateur)
|
||||
end
|
||||
|
||||
|
@ -138,7 +138,7 @@ class Procedure < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def archive
|
||||
self.update_attributes!(archived_at: Time.now)
|
||||
self.update!(archived_at: Time.now)
|
||||
end
|
||||
|
||||
def archivee?
|
||||
|
|
|
@ -25,7 +25,7 @@ class User < ActiveRecord::Base
|
|||
if user.nil?
|
||||
return User.create(email: email, password: Devise.friendly_token[0, 20], siret: siret)
|
||||
else
|
||||
user.update_attributes(siret: siret)
|
||||
user.update(siret: siret)
|
||||
user
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#!/usr/bin/env ruby
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
||||
load Gem.bin_path('bundler', 'bundle')
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'fileutils'
|
|||
include FileUtils
|
||||
|
||||
# path to your application root.
|
||||
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
||||
APP_ROOT = Pathname.new File.expand_path('../', __dir__)
|
||||
|
||||
def system!(*args)
|
||||
system(*args) || abort("\n== Command #{args} failed ==")
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'fileutils'
|
|||
include FileUtils
|
||||
|
||||
# path to your application root.
|
||||
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
||||
APP_ROOT = Pathname.new File.expand_path('../', __dir__)
|
||||
|
||||
def system!(*args)
|
||||
system(*args) || abort("\n== Command #{args} failed ==")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../boot', __FILE__)
|
||||
require File.expand_path('boot', __dir__)
|
||||
|
||||
require 'rails/all'
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
||||
|
||||
require 'bundler/setup' # Set up gems listed in the Gemfile.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Load the Rails application.
|
||||
require File.expand_path('../application', __FILE__)
|
||||
require File.expand_path('application', __dir__)
|
||||
|
||||
# Initialize the Rails application.
|
||||
Rails.application.initialize!
|
||||
|
|
|
@ -2,7 +2,7 @@ class LinkTypePieceJointeToFormulaire < ActiveRecord::Migration
|
|||
# def up
|
||||
# TypePieceJointe.find_each do |type_piece_jointe|
|
||||
# forms = Formulaire.find_by_demarche_id(type_piece_jointe.CERFA)
|
||||
# type_piece_jointe.update_attributes(formulaire_id: forms.id) if forms.present?
|
||||
# type_piece_jointe.update(formulaire_id: forms.id) if forms.present?
|
||||
# end
|
||||
# end
|
||||
end
|
||||
|
|
|
@ -46,7 +46,7 @@ class CreateFranceConnectInformation < ActiveRecord::Migration
|
|||
add_column :users, :france_connect_particulier_id, :string
|
||||
|
||||
FranceConnectInformation.all.each do |fci|
|
||||
User.find(fci.user_id).update_attributes({
|
||||
User.find(fci.user_id).update({
|
||||
gender: fci.gender,
|
||||
given_name: fci.given_name,
|
||||
family_name: fci.family_name,
|
||||
|
|
|
@ -140,7 +140,7 @@ describe Admin::AttestationTemplatesController, type: :controller do
|
|||
|
||||
context 'when something wrong happens in the attestation template creation' do
|
||||
before do
|
||||
expect_any_instance_of(AttestationTemplate).to receive(:update_attributes).and_return(false)
|
||||
expect_any_instance_of(AttestationTemplate).to receive(:update).and_return(false)
|
||||
expect_any_instance_of(AttestationTemplate).to receive(:errors)
|
||||
.and_return(double(full_messages: ['nop']))
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ describe InvitesController, type: :controller do
|
|||
|
||||
context 'when user has access to dossier' do
|
||||
before do
|
||||
dossier.update_attributes(user: signed_in_profile)
|
||||
dossier.update(user: signed_in_profile)
|
||||
end
|
||||
|
||||
it { expect { subject }.to change(InviteUser, :count).by(1) }
|
||||
|
|
|
@ -94,7 +94,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
|||
|
||||
describe '#unarchive' do
|
||||
before do
|
||||
dossier.update_attributes(archived: true)
|
||||
dossier.update(archived: true)
|
||||
patch :unarchive, params: { procedure_id: procedure.id, dossier_id: dossier.id }
|
||||
dossier.reload
|
||||
end
|
||||
|
|
|
@ -122,7 +122,7 @@ describe NewUser::DossiersController, type: :controller do
|
|||
end
|
||||
|
||||
context 'when the dossier is for an personne physique' do
|
||||
before { dossier.procedure.update_attributes(for_individual: true) }
|
||||
before { dossier.procedure.update(for_individual: true) }
|
||||
|
||||
it { is_expected.to redirect_to(identite_dossier_path(dossier)) }
|
||||
end
|
||||
|
@ -215,7 +215,7 @@ describe NewUser::DossiersController, type: :controller do
|
|||
let(:value) { nil }
|
||||
|
||||
before do
|
||||
first_champ.type_de_champ.update_attributes(mandatory: true, libelle: 'l')
|
||||
first_champ.type_de_champ.update(mandatory: true, libelle: 'l')
|
||||
allow(PiecesJustificativesService).to receive(:missing_pj_error_messages).and_return(['pj'])
|
||||
|
||||
subject
|
||||
|
|
|
@ -158,7 +158,7 @@ describe Users::SessionsController, type: :controller do
|
|||
end
|
||||
|
||||
it 'signs user out from france connect' do
|
||||
user.update_attributes(loged_in_with_france_connect: 'particulier')
|
||||
user.update(loged_in_with_france_connect: 'particulier')
|
||||
sign_in user
|
||||
delete :destroy
|
||||
expect(@response.headers["Location"]).to eq(FRANCE_CONNECT[:particulier][:logout_endpoint])
|
||||
|
|
|
@ -9,7 +9,7 @@ feature "procedure filters" do
|
|||
let!(:new_unfollow_dossier_2) { create(:dossier, procedure: procedure, state: "en_instruction") }
|
||||
|
||||
before do
|
||||
champ.update_attributes(value: "Mon champ rempli")
|
||||
champ.update(value: "Mon champ rempli")
|
||||
login_as gestionnaire, scope: :gestionnaire
|
||||
visit gestionnaire_procedure_path(procedure)
|
||||
end
|
||||
|
|
|
@ -32,7 +32,7 @@ describe Administrateur, type: :model do
|
|||
administrateur = create(:administrateur)
|
||||
user = create(:user, email: administrateur.email)
|
||||
|
||||
administrateur.update_attributes(email: 'whoami@plop.com', password: 'super secret')
|
||||
administrateur.update(email: 'whoami@plop.com', password: 'super secret')
|
||||
|
||||
user.reload
|
||||
expect(user.email).to eq('whoami@plop.com')
|
||||
|
@ -43,7 +43,7 @@ describe Administrateur, type: :model do
|
|||
administrateur = create(:administrateur)
|
||||
gestionnaire = create(:gestionnaire, email: administrateur.email)
|
||||
|
||||
administrateur.update_attributes(email: 'whoami@plop.com', password: 'super secret')
|
||||
administrateur.update(email: 'whoami@plop.com', password: 'super secret')
|
||||
|
||||
gestionnaire.reload
|
||||
expect(gestionnaire.email).to eq('whoami@plop.com')
|
||||
|
|
|
@ -163,12 +163,12 @@ describe AttestationTemplate, type: :model do
|
|||
dossier.champs
|
||||
.select { |champ| champ.libelle == 'libelleA' }
|
||||
.first
|
||||
.update_attributes(value: 'libelle1')
|
||||
.update(value: 'libelle1')
|
||||
|
||||
dossier.champs
|
||||
.select { |champ| champ.libelle == 'libelleB' }
|
||||
.first
|
||||
.update_attributes(value: 'libelle2')
|
||||
.update(value: 'libelle2')
|
||||
end
|
||||
|
||||
it { expect(view_args[:title]).to eq('title libelle1') }
|
||||
|
|
|
@ -99,12 +99,12 @@ describe TagsSubstitutionConcern, type: :model do
|
|||
dossier.champs
|
||||
.select { |champ| champ.libelle == 'libelleA' }
|
||||
.first
|
||||
.update_attributes(value: 'libelle1')
|
||||
.update(value: 'libelle1')
|
||||
|
||||
dossier.champs
|
||||
.select { |champ| champ.libelle == 'libelleB' }
|
||||
.first
|
||||
.update_attributes(value: 'libelle2')
|
||||
.update(value: 'libelle2')
|
||||
end
|
||||
|
||||
it { is_expected.to eq('libelle1 libelle2') }
|
||||
|
@ -129,7 +129,7 @@ describe TagsSubstitutionConcern, type: :model do
|
|||
let(:template) { '--libelleA--' }
|
||||
|
||||
context 'and its value in the dossier is not nil' do
|
||||
before { dossier.champs_private.first.update_attributes(value: 'libelle1') }
|
||||
before { dossier.champs_private.first.update(value: 'libelle1') }
|
||||
|
||||
it { is_expected.to eq('libelle1') }
|
||||
end
|
||||
|
@ -152,7 +152,7 @@ describe TagsSubstitutionConcern, type: :model do
|
|||
context 'champs publics are valid tags' do
|
||||
let(:types_de_champ) { [create(:type_de_champ, libelle: 'libelleA')] }
|
||||
|
||||
before { dossier.champs.first.update_attributes(value: 'libelle1') }
|
||||
before { dossier.champs.first.update(value: 'libelle1') }
|
||||
|
||||
it { is_expected.to eq('libelle1') }
|
||||
end
|
||||
|
@ -174,12 +174,12 @@ describe TagsSubstitutionConcern, type: :model do
|
|||
dossier.champs
|
||||
.select { |champ| champ.type_champ == 'date' }
|
||||
.first
|
||||
.update_attributes(value: '2017-04-15')
|
||||
.update(value: '2017-04-15')
|
||||
|
||||
dossier.champs
|
||||
.select { |champ| champ.type_champ == 'datetime' }
|
||||
.first
|
||||
.update_attributes(value: '2017-09-13 09:00')
|
||||
.update(value: '2017-09-13 09:00')
|
||||
end
|
||||
|
||||
it { is_expected.to eq('15/04/2017 2017-09-13 09:00') }
|
||||
|
@ -220,7 +220,7 @@ describe TagsSubstitutionConcern, type: :model do
|
|||
end
|
||||
|
||||
context "match breaking and non breaking spaces" do
|
||||
before { dossier.champs.first.update_attributes(value: 'valeur') }
|
||||
before { dossier.champs.first.update(value: 'valeur') }
|
||||
|
||||
shared_examples "treat all kinds of space as equivalent" do
|
||||
context 'and the champ has a non breaking space' do
|
||||
|
|
|
@ -112,7 +112,7 @@ describe Dossier do
|
|||
|
||||
it 'does not create default champs' do
|
||||
expect(subject).not_to receive(:build_default_champs)
|
||||
subject.update_attributes(state: 'en_construction')
|
||||
subject.update(state: 'en_construction')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -116,7 +116,7 @@ describe Gestionnaire, type: :model do
|
|||
gestionnaire = create(:gestionnaire)
|
||||
user = create(:user, email: gestionnaire.email)
|
||||
|
||||
gestionnaire.update_attributes(email: 'whoami@plop.com', password: 'super secret')
|
||||
gestionnaire.update(email: 'whoami@plop.com', password: 'super secret')
|
||||
|
||||
user.reload
|
||||
expect(user.email).to eq('whoami@plop.com')
|
||||
|
@ -127,7 +127,7 @@ describe Gestionnaire, type: :model do
|
|||
gestionnaire = create(:gestionnaire)
|
||||
admin = create(:administrateur, email: gestionnaire.email)
|
||||
|
||||
gestionnaire.update_attributes(email: 'whoami@plop.com', password: 'super secret')
|
||||
gestionnaire.update(email: 'whoami@plop.com', password: 'super secret')
|
||||
|
||||
admin.reload
|
||||
expect(admin.email).to eq('whoami@plop.com')
|
||||
|
|
|
@ -352,16 +352,16 @@ describe Procedure do
|
|||
procedure.types_de_champ_private << tcp_2 << tcp_1
|
||||
|
||||
dossier.build_default_champs
|
||||
dossier.champs.find_by(type_de_champ: tc_1).update_attributes(value: "value 1")
|
||||
dossier.champs.find_by(type_de_champ: tc_2).update_attributes(value: "value 2")
|
||||
dossier.champs_private.find_by(type_de_champ: tcp_1).update_attributes(value: "private value 1")
|
||||
dossier.champs_private.find_by(type_de_champ: tcp_2).update_attributes(value: "private value 2")
|
||||
dossier.champs.find_by(type_de_champ: tc_1).update(value: "value 1")
|
||||
dossier.champs.find_by(type_de_champ: tc_2).update(value: "value 2")
|
||||
dossier.champs_private.find_by(type_de_champ: tcp_1).update(value: "private value 1")
|
||||
dossier.champs_private.find_by(type_de_champ: tcp_2).update(value: "private value 2")
|
||||
|
||||
dossier2.build_default_champs
|
||||
dossier2.champs.find_by(type_de_champ: tc_1).update_attributes(value: "value 1")
|
||||
dossier2.champs.find_by(type_de_champ: tc_2).update_attributes(value: "value 2")
|
||||
dossier2.champs_private.find_by(type_de_champ: tcp_1).update_attributes(value: "private value 1")
|
||||
dossier2.champs_private.find_by(type_de_champ: tcp_2).update_attributes(value: "private value 2")
|
||||
dossier2.champs.find_by(type_de_champ: tc_1).update(value: "value 1")
|
||||
dossier2.champs.find_by(type_de_champ: tc_2).update(value: "value 2")
|
||||
dossier2.champs_private.find_by(type_de_champ: tcp_1).update(value: "private value 1")
|
||||
dossier2.champs_private.find_by(type_de_champ: tcp_2).update(value: "private value 2")
|
||||
end
|
||||
|
||||
it { expect(subject[:headers].index(tc_1.libelle.parameterize.underscore.to_sym)).to be < subject[:headers].index(tc_2.libelle.parameterize.underscore.to_sym) }
|
||||
|
|
|
@ -55,7 +55,7 @@ describe User, type: :model do
|
|||
user = create(:user)
|
||||
gestionnaire = create(:gestionnaire, email: user.email)
|
||||
|
||||
user.update_attributes(email: 'whoami@plop.com', password: 'super secret')
|
||||
user.update(email: 'whoami@plop.com', password: 'super secret')
|
||||
|
||||
gestionnaire.reload
|
||||
expect(gestionnaire.email).to eq('whoami@plop.com')
|
||||
|
@ -66,7 +66,7 @@ describe User, type: :model do
|
|||
user = create(:user)
|
||||
admin = create(:administrateur, email: user.email)
|
||||
|
||||
user.update_attributes(email: 'whoami@plop.com', password: 'super secret')
|
||||
user.update(email: 'whoami@plop.com', password: 'super secret')
|
||||
|
||||
admin.reload
|
||||
expect(admin.email).to eq('whoami@plop.com')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
||||
ENV['RAILS_ENV'] ||= 'test'
|
||||
require 'spec_helper'
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require File.expand_path('../config/environment', __dir__)
|
||||
require 'rspec/rails'
|
||||
# Add additional requires below this line. Rails is not loaded until this point!
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
ENV['RAILS_ENV'] ||= 'test'
|
||||
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require File.expand_path('../config/environment', __dir__)
|
||||
require 'rspec/rails'
|
||||
require 'capybara/rspec'
|
||||
require 'database_cleaner'
|
||||
|
|
|
@ -6,7 +6,7 @@ describe 'new_gestionnaire/dossiers/identite_entreprise.html.haml', type: :view
|
|||
let(:entreprise) { rna_information.entreprise }
|
||||
|
||||
context "date_publication is missing on rna" do
|
||||
before { rna_information.update_attributes(date_publication: nil) }
|
||||
before { rna_information.update(date_publication: nil) }
|
||||
|
||||
it "can render without error" do
|
||||
expect(rendered).to include("Date de publication :")
|
||||
|
|
Loading…
Reference in a new issue