Web application for organizing and managing lecture participation, written in Ruby on Rails.
Created in the Software Engineering II course at HPI in Potsdam.
Productive url: https://hpi-lectureportal.herokuapp.com/ (will be deployed on every push to master)
Test url: https://hpi-lectureportal-dev.herokuapp.com/ (will be deployed on every push to dev)
- Ensure Ruby v2.5.1 (
ruby -v
) with rbenv or RVM - Ensure Bundler v2.0.2 (
bundle -v
) withgem install bundler -v 2.0.2
bundle install --without production
Install the required Ruby gem dependencies defined in the Gemfile, skipping gems used for production (like pg)rails db:migrate db:seed
Setup database, run migrations, seed the database with defaultsrails s
Start the Rails development server (By default runs on localhost:3000)bundle exec rspec
Run all the tests (using the RSpec test framework)- Set the environment variable SECRET_KEY to the secret value that lecturers should enter to gain lecturer privilege. If it is not set, the secret key is IAmALecturer.
bundle exec rails db:migrate RAILS_ENV=development && bundle exec rails db:migrate RAILS_ENV=test
Migrate both test and development databasesbundle exec rails assets:clobber && bundle exec rails assets:precompile
Redo asset generation
- To run the full test suite:
bundle exec rspec
. - For fancier test running use option
-f doc
bundle exec rspec spec/<rest_of_file_path>.rb
Specify a folder or test file to run- specify what tests to run dynamically by
-e 'search keyword in test name'
bundle exec rspec --profile
examine how much time individual tests take
- RuboCop is a Ruby static code analyzer and formatter, based on the community Ruby style guide
- It is installed in the project. Run
bundle exec rubocop
to find possible issues. - Use
--auto-correct
to fix what can be fixed automatically. - The behavior of RuboCop can be controlled via a
.rubocop.yml
configuration file
rails c --sandbox
Test out some code in the Rails console without changing any datarails dbconsole
Starts the CLI of the database you're usingbundle exec rails routes
Show all the routes (and their names) of the applicationbundle exec rails about
Show stats on current Rails installation, including version numbers
rails g migration DoSomething
Create migration _db/migrate/*DoSomething.rb.