This is the code base for the UK Government and Parliament's petitions service.
We recommend using Docker Desktop to get setup quickly. If you'd prefer not to use Docker then you'll need Ruby (2.4+), Node (10+), PostgreSQL (9.6+) and Memcached (1.4+) installed.
docker-compose run --rm web rake db:setup
docker-compose run --rm web rake epets:add_sysadmin_user
docker-compose run --rm web rails runner 'FetchCountryRegisterJob.perform_now'
docker-compose run --rm web rails runner 'FetchRegionsJob.perform_now'
docker-compose run --rm web rails runner 'FetchConstituenciesJob.perform_now'
docker-compose run --rm web rails runner 'FetchDepartmentsJob.perform_now'
docker-compose run --rm web rails runner 'Site.enable_signature_counts!(interval: 10)'
docker-compose up
Once the services have started you can access the front end, back end and any emails sent.
You can run the full test suite using following command:
docker-compose run --rm web rake
Individual specs can be run using the following command:
docker-compose run --rm web rspec spec/models/parliament_spec.rb
Similarly, individual cucumber features can be run using the following command:
docker-compose run --rm web cucumber features/suzie_views_a_petition.feature