public
Description: Rails tech talk
Homepage:
Clone URL: git://github.com/britt/tech-talk.git
name age message
file .gitignore Tue Jun 02 15:08:52 -0700 2009 Added URL slug generation [britt]
file README.mdown Wed Jun 03 12:00:23 -0700 2009 README Changes [britt]
file Rakefile Mon Jun 01 17:05:27 -0700 2009 initial import [britt]
directory app/ Tue Jun 02 16:26:24 -0700 2009 Added smart ass quip [britt]
directory config/ Tue Jun 02 16:07:24 -0700 2009 Created redirects controller [britt]
directory db/ Tue Jun 02 16:22:58 -0700 2009 Added RJS response to link creation [britt]
directory doc/ Mon Jun 01 17:05:27 -0700 2009 initial import [britt]
directory lib/ Tue Jun 02 15:00:04 -0700 2009 Added first model and tests [britt]
directory public/ Tue Jun 02 16:07:24 -0700 2009 Created redirects controller [britt]
directory script/ Tue Jun 02 15:00:04 -0700 2009 Added first model and tests [britt]
directory spec/ Tue Jun 02 16:07:24 -0700 2009 Created redirects controller [britt]
directory test/ Mon Jun 01 17:05:27 -0700 2009 initial import [britt]
README.mdown

Tech talk sample application

How to install Rails

  sudo gem install rails

Create the application

  rails url_shortener

Install the RSpec-Rails gem

Edit environments/test.rb and add the following

Then run

rake gems:install RAILS_ENV=test
script/generate rspec

If you are using Rubymine

  • Go to Project Settings > Ruby SDK and Gems
  • Click 'Attach gems'
    • Add Rspec
    • Add Rspec-rails

Model

Generate the Url model

script/generate rspec_model Url

Modify the generated migration to create the database schema

rake db:migrate db:test:prepare

Modify the generated model spec. Add tests for your model.

Controller

script/server