The RSS Reader is a small interview exercise which makes use of a variety of Ruby on Rails techniques and gems.
-
Download the code from the Git repository
-
rake db:migrate (uses MySQL)
-
“rake spec” should pass - to test the unit tests
-
“rake cucumber” should pass - to test the integration tests
-
Run “mysql -u root -D <database> < load/profile_type.txt” to load the profile_type table.
-
Start the Rails server on port 2100
-
Test localhost:2100/ to confirm that the Home screen shows up.
These steps are provided if someone wishes to build a tutorial for this application.
-
Run the command “rails new rss_reader –skip-unit-test –skip-prototype –skip-bundle -J -T”
-
Add ‘therubyracer’ and ‘mysql2’ to bundle, and do bundle install.
-
Edit config/database.yml, tailored for the specific database.
-
add ‘devise’ to bundle and do ‘bundle install’
-
rails generate devise:install (installs config/initializers/devise.rb and
localization file)
-
Configure config.mailer_sender in config/initializers/devise.rb
-
Add gem bootstrap-sass
-
Add app/views/layouts/application.html.erb (based on Twitter Bootstrap)
-
Add app/views/layouts/_messages.html.erb (Twitter Bootstrap)
-
Add app/views/layouts/_navigation.html.erb (Twitter Bootstrap)
-
Add app/assets/javascripts/application.js (Twitter Bootstrap)
-
Add app/assets/stylesheets/application.css.scss (Twitter Bootstrap)
-
Add app/assets/stylesheets/bootstrap_and_overrides.css.scss (Twitter Bootstrap)
-
Add gems for JQuery UI (at this point there are no widgets in use)
-
rake db:create
-
rails generate devise User
-
add password_confirmation to config/application.rb (filter_parameters)
-
add simple_form gem
-
list of devise modules: database_authenticatable; registerable; recoverable; rememberable; trackable; validatable; confirmable; omniauthable
-
rake db:migrate
-
Add gem omniauth
-
rails generate migration AddFieldsToUsers first_name last_name login
-
modify the migration to put required on the 3 fields
-
gem rspec-rails, capybara, cucumber-rails, database_cleaner, email_spec, factory_girl_rails (for testing)
-
rails generate rspec:install
-
rails generate cucumber:install –capybara –rspec
-
Add DatabaseCleaner blocks to spec/spec_helper.rb
-
Add spec/factories/users.rb, to create users
-
Add spec/support/devise.rb, for controller tests
-
Add an email spec in spec/spec_helper.rb
-
In config/application.rb, don’t generate RSpec tests for views and helpers
-
rake -T confirms that cucumber and rspec are there
-
Write Rspec tests for users_controller, home_controller, and user model. At this point “rake spec” won’t yet work.
-
features/support/email_spec.rb (I have used email.rb)
-
rails generate email_spec:steps
-
add support/paths.rb, step_definitions/user_steps.rb, users tests
-
rake cucumber will fail.
-
modify config/environments/development.rb to set action_mailer for mailing, and modify test too
-
modify model for presence and uniqueness checking
-
rails generate devise:views (this is the registerable module)
-
remove public/index.html
-
rails generate controller home index –no-controller-specs
-
Edit routes
-
add first_name, last_name, login to app/views/devise/registrations/edit and new.
-
Tweak Cucumber test for sign_out (get vs. delete)
-
Add gems oauth2, omniauth-facebook, omniauth-twitter
-
rails generate migration AddFields2ToUsers provider uid
-
rake db:migrate
-
add :provider and :uid to attr_accessible
-
add to config/initializers/devise.rb
-
add profile_type table
-
add Kaminari gem for pagination of channels.