Dématérialiser et simplifier les démarches administratives
Find a file
2017-12-14 18:32:48 +01:00
.circleci Use the i386 cache template key : https://discuss.circleci.com/t/use-the-arch-cache-template-key-if-you-rely-on-cached-compiled-binary-dependencies/16129 2017-10-02 18:10:25 +02:00
app Remove the featured styling on the annotations privées tab content 2017-12-14 18:32:48 +01:00
bin Add and install delayed_job gem 2017-09-27 16:47:32 +02:00
config [Fix #1060] fix tag in api documentation title 2017-12-11 16:09:58 +01:00
db Add timestamps on Entreprises 2017-12-08 09:15:45 +01:00
doc [fix #1000] export name and first name in api 2017-12-11 15:29:56 +01:00
lib Add timestamps on Entreprises 2017-12-08 09:15:45 +01:00
log First Commit 2015-08-10 11:05:06 +02:00
public Fix features tests 2016-11-15 11:01:58 +01:00
spec [Fix #866] Allow use of non-breaking spaces in balise in attestation template 2017-12-14 17:22:21 +00:00
vendor/assets Add map for gestionnaire 2017-09-06 11:11:28 +02:00
.editorconfig Add a .editorconfig file 2017-04-04 17:32:36 +02:00
.gitignore [Ref #288] Remove /bin from .gitignore, add binstubs 2017-05-12 17:40:22 +02:00
.haml-lint.yml Detect implicit divs with haml-lint 2017-04-26 17:01:45 +02:00
.rspec First Commit 2015-08-10 11:05:06 +02:00
.rubocop.yml Enable all the rubicop perf cops 2017-11-21 10:31:16 +01:00
.ruby-version Ruby version: go for 2.3.5 2017-11-02 17:44:29 +01:00
.scss-lint.yml Isolate new design stylesheets 2017-05-17 18:06:53 +02:00
config.ru Delete redis and actioncable 2017-10-12 07:21:02 +02:00
Gemfile Remove the newrelic gem and configuration 2017-12-04 10:33:41 +01:00
Gemfile.lock RackMiniProfiler: bump version to 0.10.7 2017-12-07 17:32:49 +01:00
Guardfile Enable the Layout/EmptyLines cop 2017-06-13 10:35:20 +02:00
LICENSE.agpl-3.0.txt Add license 2017-04-03 11:05:37 +02:00
Rakefile Enable the Layout/EmptyLines cop 2017-06-13 10:35:20 +02:00
README.md Readme: take new AutoReceiveDossiersForProcedureJob parameter 2017-12-11 17:17:47 +01:00

TPS - Téléprocédures Simplifiées

Context

Téléprocédures Simplifiées, ou TPS pour les intimes, est une plateforme 100 % web et 0 % email, conçue afin de répondre au besoin urgent de l'État d'appliquer la directive sur le 100 % démat' à l'horizon 2018 pour les procédures administratives.

Dépendances

Tous environnements

  • postgresql

Développement

  • Mailcatcher : gem install mailcatcher

Tests

  • PhantomJS

Initialisation de l'environnement de développement

Afin d'initialiser l'environnement de développement, éxécutez la commande suivante :

bundle install

Création de la base de données

Les informations nécessaire à l'initialisation de la base doivent être pré-configurées à la main grâce à la procédure suivante :

su - postgres
psql
> create user tps_development with password 'tps_development' superuser;
> create user tps_test with password 'tps_test' superuser;
> \q

Afin de générer la BDD de l'application, il est nécessaire d'éxécuter les commandes suivantes :

# Create and load the schema for both databases
rake db:create db:schema:load

# Migrate the development database and then the test database
rake db:migrate
rake db:migrate RAILS_ENV=test

Création des comptes initiaux

rails c
> email = "<votre email>"
> password = "<votre mot de passe>"
> Administration.create(email: email, password: password)
> Administrateur.create(email: email, password: password)
> Gestionnaire.create(email: email, password: password)
> User.create(email: email, password: password)

Lancement de l'application

bin/delayed_job run
mailcatcher -f
rails s

Programmation des jobs

AutoArchiveProcedureJob.set(cron: "* * * * *").perform_later
WeeklyOverviewJob.set(cron: "0 8 * * 0").perform_later
AutoReceiveDossiersForProcedureJob.set(cron: "* * * * *").perform_later(procedure_declaratoire_id, "received")

Exécution des tests (RSpec)

Pour exécuter les tests de l'application, plusieurs possibilités :

  • Lancer tous les tests

      rake spec
      rspec
    
  • Lancer un test en particulier

      rake spec SPEC=file_path/file_name_spec.rb:line_number
      rspec file_path/file_name_spec.rb:line_number
    
  • Lancer tous les tests d'un fichier

      rake spec SPEC=file_path/file_name_spec.rb
      rspec file_path/file_name_spec.rb
    

Linting

  • Faire tourner RuboCop : bundle exec rubocop -R
  • Faire tourner Brakeman : bundle exec brakeman -z
  • Linter les fichiers HAML : bundle exec haml-lint app/views/
  • Linter les fichiers SCSS : bundle exec scss-lint app/assets/stylesheets/

Déploiement

  • Tout nouveau commit ajouté à la branche dev est automatiquement déployé en intégration
  • Tout nouveau commit ajouté à la branche master est automatiquement déployé en production

Régénérer les binstubs

bundle binstub railties --force
rake rails:update:bin