This is an interactive exercise introducing the basics of web development with Ruby on Rails 6. It is used in the course SWTII. The exercise is partly based on the offical "Getting Started with Rails" guide, so in case of getting stuck, that might be a good start to find solutions. The interactivity of this exercise is provided by opening issues in the GitHub issue tracker (through automation in a CI server). The issues contain the currently failing test case and the corresponding error message as well as instructions on what tasks to tackle next.
This repository contains an application stub of an academic paper management system with a failing test case.
Follow these steps to complete the software and the exercise:
Log-in / Sign-up with travis-ci.com and enable automatic builds for your exercise repository
YOUR_GH_USER_HERE
with your GitHub user name)Ensure that the issue tracker of the GitHub repository is active. This can be done in the repository's "Settings" tab on the GitHub website.
git clone
. You might want to clone using SSH instead of HTTPS, to avoid having to type credentials when pushing.
ruby --version
. It should be 2.7.2
. Other Ruby versions might work, but this one was tested.rbenv install 2.7.2
, might take a few minutes).ruby_version
file in the repository instructs the ruby version manager to use the correct version.vagrant ssh #connect with VM
cd <app_folder>
rails s -b 0 #starting rails server, the -b part is necessary since the app is running in a VM and would otherwise drop the requests coming from the host OS
bundle install
to install the dependencies of the project (they are stored in the Gemfile
)
bundle
command was not found, install bundler with gem install bundler
rails db:migrate RAILS_ENV=development && rails db:migrate RAILS_ENV=test
to migrate the databaserails s
) and check that the application runs (default: http://localhost:3000/
)rspec
to run the tests (RSpec is a test framework for Ruby)Failing test for #<ISSUE NUMBER>
.rails s
starts the development server (by default on http://localhost:3000) so you can try out your app in the browser.rails routes
shows all available routes of the application.rspec spec/<path_to_spec>.rb
to only run tests within a single file./spec/factories
to get inspiration for your data model.rails db:drop && rails db:migrate
deletes the database and recreates it. This might be helpful for error recovery.git status
) and pushed to the upstream repository (i.e., the one on GitHub) before the deadline.