diff --git a/Testing.md b/Testing.md index af4cddb..f47c4bf 100644 --- a/Testing.md +++ b/Testing.md @@ -1,24 +1,25 @@ -# Testing - Testing Tracks is fairly simple. For its tests two different technologies are used: -* MiniTest unit, functional, and integration tests (in `/test`) -* Cucumber acceptance tests (in `/features`) +* [minitest](https://github.com/seattlerb/minitest) for unit, functional, and integration tests (in `/test`) +* [Cucumber](http://cukes.info/) for acceptance tests (in `/features`) ## Setup ### Gems The tests make use of some gems which need to be installed first. If you have previously done a `bundle install --without development test` you will need to edit your `.bundle/config` and re-run `bundle install`. +### Database +(database instructions need to be added) + ## Running the tests ### Running the unit, functional, and integration tests -From the root directory of the project, run +To run the entire minitest suite, from the root directory of the project, run ``` bin/rake test ``` -To run an individual test file, append the name of the file, as in +To run an individual test file, append the path to the file, as in ``` bin/rake test test/models/project_test.rb ``` @@ -28,8 +29,6 @@ To run a single test, include the name of the file and the name of the test itse bin/rake test test/models/project_test.rb test_has_default_context ``` -If it completes successfully with 0 failures, you're good to go! - ### Running the acceptance tests For integration testing Tracks uses cucumber. For those features that require javscript/ajax, Tracks uses Selenium and Capybara @@ -37,19 +36,19 @@ For integration testing Tracks uses cucumber. For those features that require ja To run all the features excluding the work-in-progress (wip) features, run ``` -bundle exec rake cucumber RAILS_ENV=development +bin/rake cucumber RAILS_ENV=development ``` This will execute all features, including those using Selenium. To run the features that are work in progress run these: ``` -bundle exec rake cucumber:wip +bin/rake cucumber:wip ``` To run a feature by hand run these. ``` -bundle exec cucumber features/my_feature.feature +bin/cucumber features/my_feature.feature ``` If you encounter problems running selenium tests, look at the _Problems with cucumber selenium tests_ section below.