-
Notifications
You must be signed in to change notification settings - Fork 21
Contributing
Please take note of the following sections if you're contributing to the Jolly Advisor.
- Clone:
git clone https://github.com/hacsoc/the_jolly_advisor.git
- New branch:
git checkout -b my-branch
- Install rvm: https://rvm.io
- Switch to Ruby 2.3.0
rvm install 2.3.0
- Install bundle:
gem install bundler
- Install postgres; setup postgres; create database. This is platform specific. Next:
-
su - postgres; createuser --interactive
use your system username when it asks for role to add createdb the_jolly_advisor_development
exit
cd /path/to/the_jolly_advisor
- Install gems:
bundle
- You may run in to problems with
libv8
ortherubyracer
. To get around this, try doing the following:gem install libv8 -v [VERSION] -- --with-system-v8
-
gem install therubyracer -v [VERSION] -- --with-system-v8
- Also, this is apparently another option.
- Finally,
bundle
to get the rest of the gems.
- Migrate db:
rake db:migrate
this might take a few minutes - Open rails console; get SIS data
rails c
require “sis_importer”
SISImporter.import_sis
- Start local server:
rails s
- Server will be available at http://localhost:3000/
- Clone from git:
git clone https://github.com/hacsoc/the_jolly_advisor.git
- Do work on a separate branch:
git checkout -b aaron-dev
- Finish your work and merge in master:
git fetch origin master
;git merge master
- Push your code to github:
git push origin aaron-dev
- Create pull request from Github UI
- Wait to get a 👍 from another team member before merging
We have the guard gem installed to help you with your TDD-ness. It's so agile. It watches for file changes and then runs the corresponding tests. This way you know right away if you broke anything. For more info, see their GitHub.
When working on The Jolly Advisor, you should always have a terminal open running guard. It will probably save you headaches in the long run.
We use FactoryGirl to generate data for testing. Factories are defined in spec/factories/.
We use RSpec for our unit tests. They live the spec/ directory.
We use cucumber for our feature tests. They live in features/.
To get cucumber up and running:
createdb the_jolly_advisor_test
rake db:test:prepare
Then run tests with
rake cucumber
-
rake
: runs all specs and then all feature tests -
rake spec
: runs all specs-
rspec [files]
: runs specific spec files. This is much faster than usingrake
.
-
-
rake cucumber
: runs all feature tests-
cucumber [files]
: runs specific feature files. Much faster than usingrake
.
-
Travis CI will run tests when you submit a pull request, but if you're using TDD (see above), you can and should be running tests locally before submitting a pull request so you know your changes work.
This is actually important info. It took Steph and Andrew a long time to get this working.
config/database.yml.travis holds the database configuration for the test database that Travis uses. This is because we use a different username for our postgres db than Travis does.
The actual Travis configuration is in .travis.yml. Things to note:
-
cache: bundler
caches gem installs across builds, significantly reducing build times. -
before_script
:- Copies over the travis db config to be used by the Travis CI server
- Creates the postgres database
- Runs the migrations
- FactoryGirl needs to be
require: false
in the Gemfile. See this post if you want to know why.
Should you ever need to change this, please refer to the Travis-CI Docs and make sure you understand the current setup before modifying.
- Use Github issues to note bugs and feature requests
- If opening an issue, use the appropriate labels to help us prioritize issues better.