Decko application code used at Wikirate.org
Like all Decko decks, WikiRate's code is organized in mods.
The following will help set up a functioning wikirate site with a small subset of (mostly fake) data. Some pages will not look complete.
- fork repo on github: https://github.com/wikirate/wikirate/
- clone repo:
git clone git@github.com:YOURNAME/wikirate.git
- enter dir:
cd wikirate
- init/update submodules
git submodule update -f --init --recursive
- install gems:
bundle install
- set up config:
cp -R sample_config/* config
- populate dev database (with test data):
DATABASE_NAME_TEST=wikirate_dev bundle exec rake wikirate:test:seed
or start fresh with a subject of your choice:bundle exec rake wikirate:new_with_subject Camels
- add AWS credentials to config/application.rb (Ask wikirate dev team! Sorry, we'll make this easier soon)
- to make assets like icons work:
bundle exec rake decko:update_assets_symlink
- reset machines
rake card:reset_machine_output
- start server:
bundle exec decko s
note:
- initial homepage load will take a long time.
- You can log into the test data with:
- joe@user.com / joe_pass, or
- joe@admin.com / joe_pass
- populate test database:
bundle exec rake wikirate:test:seed
- start rspec with
decko rspec
and cucumber withdecko cucumber
.
Alternatively, you can use the shorter commands decko rs
and decko cc
To run specific tests, you can add --
followed by the test file.
Eg. decko rs -- /my/file/is/here
Sample tests contained here:
Paths:
mod/*/spec # rspec and jest tests
mod/*/features # cucumber tests
mod/*/features/step_definitions # cucumber step definitions
You need node.js (>=6) and yarn installed.
To set up CoffeeScript testing run yarn install
.
Start tests with yarn jest test
.
Jest is configured to run all .coffee
files in mod/**/spec
folders.
The configuration can be changed in package.json
.
The basic setup for Jest with jquery and Decko's coffeescript is loaded in
test/setup_jest.js
.
See mod/wikirate/spec/lib/javascript/script_wikirate_common.test.coffee
for
a simple example.
See documentation here: https://github.com/capistrano/maintenance
quick examples:
# turn on maintenance message with defaults
cap production maintenance:enable
# turn on maintenance message with more info
cap production maintenance:enable REASON="database update" UNTIL="in a minute or two"
# turn maintenance message off
cap production maintenance:disable