Updated Testing (markdown)

Dan Rice 2014-06-11 08:47:46 -07:00
parent 8e431bd902
commit e95ed216f6

@ -1,24 +1,25 @@
# Testing
Testing Tracks is fairly simple. For its tests two different technologies are used: Testing Tracks is fairly simple. For its tests two different technologies are used:
* MiniTest unit, functional, and integration tests (in `/test`) * [minitest](https://github.com/seattlerb/minitest) for unit, functional, and integration tests (in `/test`)
* Cucumber acceptance tests (in `/features`) * [Cucumber](http://cukes.info/) for acceptance tests (in `/features`)
## Setup ## Setup
### Gems ### 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`. 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 tests
### Running the unit, functional, and integration 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 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 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 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 ### Running the acceptance tests
For integration testing Tracks uses cucumber. For those features that require javscript/ajax, Tracks uses Selenium and Capybara 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 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. This will execute all features, including those using Selenium.
To run the features that are work in progress run these: 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. 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. If you encounter problems running selenium tests, look at the _Problems with cucumber selenium tests_ section below.