Skip to content

Initial Seeding and Running

rdsubhas edited this page Apr 30, 2013 · 3 revisions

Make sure

  • You have the RapidFTR codebase
  • You have installed Ruby, CouchDB and all other necessary software (follow the instructions for OSX, Windows or Linux in the wiki)
  • You have run bundle install to install all the gems

If you have not yet created username/password for CouchDB:

  • Either run: bundle exec rake db:create_couch_sysadmin[<desired-username>, <desired-password>]

(OR)

  • Go to: localhost:5984/_utils (assuming that's where your CouchDB is running)
    • Click on "Signup" at the bottom right
    • And choose what username and password you want to use

Once you have a username/password for CouchDB:

  • Run: bundle exec rake db:create_couchdb_yml[<username>, <password>]

That will create the CouchDB configuration file at config/couchdb.yml

Seeding the Database

  • Run: bundle exec rake app:reset This will add all the seed data (users and form sections)

Running tests

  • To run unit tests: RAILS_ENV=test bundle exec rake spec
  • To run cucumber headless tests: RAILS_ENV=cucumber bundle exec rake cucumber:headless
  • To run cucumber browser tests: RAILS_ENV=cucumber bundle exec rake cucumber:browser

Running the server:

  • Like any Rails project, run: rails server

  • To start Solr (required for searching), run: bundle exec rake sunspot:clean_start

  • To start the background scheduler, run: bundle exec rake scheduler:restart

  • To run all these in one go, run: bundle exec rake app:run

Most of the time, you won't need the Scheduler (unless you're doing some work on the Scheduler). So its enough if you just start Solr, and henceforth just use rails server normally as in any rails project.

Clone this wiki locally