This is a Rails application to enable citizens to check when their convictions are spent. It is based on software patterns developed for the [C100 Application][c100-application].
This service follows several rules to calculate spent dates of multiple convictions, we have documented all of the scenarios known to us in our tests:
- spec/services/calculators/multiples/given_scenarios_spec.rb
- spec/services/calculators/multiples/multiple_offenses_calculator_spec.rb
We have also added visual graphics to better aid understanding:
Please refer to the following for more information:
- https://www.gov.uk/guidance/rehabilitation-periods
- https://hub.unlock.org.uk/advice/detailedguideroa/
- https://docs.google.com/spreadsheets/d/1ZSCk-wgMfIc22GQahKH_ys4u-E9GWIn6dQ7mm5t1RFI/edit#gid=2019860123
It is important to understand how convictions work, as this is the main reason for the existence of this service.
Work should be based off of, and PRed to, the main branch. We use the GitHub PR approval process so once your PR is ready you'll need to have one person approve it, and the CI tests passing, before it can be merged.
Clone this repository then cd
into the new directory
$ git clone git@github.com:ministryofjustice/disclosure-checker.git
$ cd disclosure-checker
If you don't have rbenv
already installed, install it as follows:
$ brew install rbenv ruby-build
$ rbenv init
Follow the instructions printed out from the rbenv init
command and update your ~/.bash_profile
or equivalent file accordingly, then start a new terminal and navigate to the repo directory.
Use rbenv
to install the latest version of ruby as defined in .ruby-version
(make sure you are in the repo path):
$ rbenv install
Node.js:
$ brew install node
Yarn
$ brew install yarn
Postgresql
$ brew install postgresql
Use the following commands to install gems and javascript packages then create the database
$ bin/setup
$ bin/yarn install
$ bin/rails server
The site will be accessible at http://localhost:3000.
unit tests only:
$ bundle exec rspec
feature tests only:
$ bundle exec cucumber
all tests and linters:
$ bin/rake
Any exceptions raised in any deployed environment will be sent to Sentry.