-
Get the project by using the command ‘git clone github.com/jeroeningen/testopdracht.git’
-
Create the database.yml in config/database.yml
-
Install the necessary gems by using command ‘bundle install’
-
Setup the database using the commands ‘rake db:create’ and ‘rake db:migrate’. If you need the test database, please also run ‘rake db:test:clone’
-
Start the server with command ‘rails s’
-
THAT’S IT.
When you’re using Linux, before you run the command ‘bundle install’, make sure you installed the following packages as well:
-
ruby1.8-dev
-
libxml2
-
libxslt-dev
-
libxml2-dev
-
libmysql-ruby
-
libmysqlclient-dev
-
xvfb
By default this application uses Capistrano and Phusion Passenger (mod_rails) This application includes deploy scripts for production and development environment. Note that Capistrano creates the databases for you, you do not need to create it yourself. Although you have to create your Apache directive yourself. It should look like as follows:
RailsBaseURI /testopdracht_production <Directory /var/www/testopdracht_production> Options -MultiViews </Directory> RailsBaseURI /testopdracht_development <Directory /var/www/testopdracht_development>
RailsEnv development
Options -MultiViews </Directory>
This application comes with Cucumber and Rspec tests (including autotest)
To run the Cucumber tests, use the command ‘cucumber’.
To run the Rspec tests, use the command ‘autotest’. Note that Growl-notifications are disabled by default, see the file ~/.autotest.
Cucumber is now intergrated in the command ‘autotest’. The autotest assumes you have a virtual frame buffer running on ‘DISPLAY=:99’. To initialize the virtual frame buffer you can use the script ‘xvfb’ that is included in the ‘script’ directory. Note that this script requires the package ‘xvfb’
-
Help, my Cucumber installation seems to be broken!
-
Please remove the Cucumber gem with the command ‘sudo gem uninstall cucumber-rails’ and then run the command ‘bundle install’.
-
The commands ‘autotest’ and/or ‘cucumber’ are not working.
-
Please use the command ‘bundle exec autotest’ and ‘bundle exec cucumber’ instead.
-
LOSER! Your Cucumber tests are broken! It won’t return the area where I’m living, when I enter my zipcode.
-
This is probably a performance issue; the Cucumber tests are unfortunately quite heavy. Please make sure the Rspec-tests are running well and rerun the Cucumber test while your computer is in idle.
-
You bundled the gem ‘rcov’. How can I use it?
-
Please run ‘rake rcov:rspec’ for RSpec and ‘rake rcov:cucumber’ for Cucumber. Results are written to the directory ~/coverage.