Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

100 lines (59 sloc) 1.853 kB

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.

  rake hypatia:ci

To run all the tests without that, do

  rake hypatia:spec

Running Specs Only

  rake hypatia:spec

Running Features Only

From

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.

Writing tests

Writing Specs

Writing Features

(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.

Jump to Line
Something went wrong with that request. Please try again.