09
- 9.1 Write scripted unit tests
- Learning Objectives
- View and run unit tests
9.1 Write scripted unit tests
Learning Objectives
By the end of this lesson you will be able to:
- View and run unit tests.
View and run unit tests
- If you haven’t done so already, run the TargetEnvironment job on your Jenkins instance.
SSH into this target environment instance. Your Public DNS will be different
“` $ ssh -i ditc.pem ec2-user@IPADDRESS
“`
Go to the Rails deployment directory.
“` $ cd /var/www/rails
“`
Apply database tables
“` $ sudo rake db:migrate
“`
Prepare the tests using Rake
“` $ sudo rake test:prepare
“`
Run Bundler. Files to download are specified in Gemfile
“` $ sudo bundle install
“`
Run the RSpec tests
“` $ sudo rspec spec/
“`