Developing for Bandido Person - 1000Memories/Documentation GitHub Wiki

This document details how to get Bandido Person up and running locally, and how to write code for it.

1. Prerequisites

Setup your development environment first. Then clone the repository to your local machine and cd into it:

git clone [email protected]:1000Memories/acom-bandido-plus.git
cd acom-bandido-plus

The first time you cd into the project directory, RVM should prompt you to accept the gemset. Press y to accept.

Installing/updating dependencies

Ruby has a tool called bundler that lets you easily manage dependencies (it's similar to Nuget Package Manager). If you haven't already, install it with gem install bundler.

Dependencies are defined in Gemfile. Run bundle install to install/update these dependencies.

Database migrations

Run rake db:migrate to migrate your database schema to the most current version. To get tests working, you will also have to run RACK_ENV=test rake db:migrate to migrate the test database.

2. Starting the app

Run foreman start to start the app on http://localhost:5000 .

If you want to generate some sample Bandido Person pages, run rake db:seed[user_id], replacing user_id with your own ACOM user ID (this will allow you to test both edit and non-edit mode of Bandido Person).

3. Running server-side tests

We use RSpec for server-side testing: https://www.relishapp.com/rspec

Install autotest if you haven't already with gem install autotest. This will rerun tests automatically when you save files.

To run the tests, just enter autotest into the terminal.

4. Running client-side tests

We use Jasmine for client-side testing: http://pivotal.github.io/jasmine/

Run the following to start up these tests:

rake guard
rake jasmine

You can then open http://localhost:8888 to run the tests. Guard will recompile the JS / tests when you save files.