Testing basics for Hypatia
Prerequisites for testing:
(1) Migrate the Test Databases
rake db:migrate RAILS_ENV=test
(2) Spin up Jetty for Fedora and Solr test instances
blah blah config/solr.yml config/fedora.yml
blah blah copy of jetty for testing configured to correct ports
(separate submodule? rake task to copy development jetty and change port?)
blah blah spin up jetty (rake task?)
rake hydra:jetty:load environment=test
Running All Tests
This is the job run by our continuous integration server. It spins up jetty, blah blah.
To run all the tests without that, do
Running Specs Only
Running Features Only
rake -T hypatia has rake hypatia:cucumber # Easieset way to run cucumber features. rake hypatia:cucumber:fixtures_then_run # (Re)loads fixtures, then runs cucumber features. rake hypatia:cucumber:run # Run cucumber features for hypatia.
(0) create a git branch for the feature
git checkout -b neat_idea
(1) create feature file
(2) write the scenario(s)
(3) run the new feature – it should fail
the feature should run, but it should fail. (Avoid false positives.)
all other features should pass.
(4) code the change
(5) run the new feature – it should pass
(6) run ALL features – they should pass
(7) run ALL tests – they should pass
(8) check in the new feature and the changed code
git add git commit -m "coded neat idea feature"
you may want to bring this change into the master branch
you may want to push this change to your remote git repos.