Skip to content
This repository has been archived by the owner on Jul 3, 2018. It is now read-only.

ministryofjustice/accelerated_claims

Repository files navigation

** Unmaintained repository! **

Accelerated Claim application (aka 'Civil-Claims' and 'Accelerated Possessions')

Build Status

Code Climate

Test Coverage

This is the source code of what is currently a minimum viable product for the Civil Claims exemplar. The application consists in a single form that claimants of accelerated claims fill out to download a PDF. The PDF is the standard accelerated claim form from HMCTS, is filled out with the details that the claimant has provided, and can be signed and sent by post.

Local setup

Install the following:

Configuration data is loaded from the .env file (via dotenv gem). The default configuration will work for local development, but see the file for optional variables.

Install the bundle, then start the rails server and PDF strike through service:

bundle install
foreman start

See the Procfile for individual startup invocations.

Additional documentation

Production deployment

Please remember to set the environment SECRET_KEY_BASE variable.

Dockerisation

Introduction

Stephen Richards and Mike Pountney are working on dockerizing this app in order to provide a standardised environment for development, deployment and production running.

Development environment

The development environment uses Virtual Box and Vagrant to create a linux vm in which to run the docker container. The Vagrantfile and Dockerfile in this project contain all the instructions necessary to provision the vm, create and run the docker container, and run the app inside the container.

Setting up the VM and docker container

vagrant up

The app runs on port 3000 inside the container, which is exposed to the outside world as port 3002 on localhost, therefore to see your app running, navigate to http://localhost:3002

Running tests on the app running in the container

Unit, lib, routing and controller specs can, and should, be run inside the container. There is a rake task spec:docker set up to do this:

vagrant ssh 			                 # ssh into the virtual machine
docker ps 				                 # get the container id of the docker container running in the virtual machine
docker exec -i -t <container_id> bash    # get an interactive shell inside the docker container
rake spec:docker                         # run all the tests in ```spec/lib spec/models spec/routing spec/controllers```

Feature tests should be run on localhost against the instance running in the container by specifying docker as the remote environment. This can also be done using the spec:features rake task.

env=docker rspec spec/features

or rake spec:features

Dependencies

Postcode lookup

  • We are using Ideal postcodes.
  • API key is set in ENV
  • Account info is in HMCTS Confluence under Ideal postcodes