Skip to content

tweetegy/rspec_legacy_rails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSpec Legacy Rails App

Example Rails app to demonstrate a fairly recent version of RSpec, Capybara and Factory Girl working with legacy versions of Rails (2.3.11) and Ruby (1.8.7). Note that this application does not specify which version of Ruby to use. However, it has, of course, been tested on Ruby 1.8.7. I expect it will work in later versions of Ruby too!

This application is NOT an example or Rails best practices! Its only purpose is to demonstrate running RSpec Model and Integration specs against the above mentioned version of Rails and Ruby.

One other thing to note is that I have ONLY tried out Model and Integration (or Feature) specs in this app. This is mainly becuase these are the main set of spec types that I usually work with. Having said that, the Controller specs would be useful if we need to work with legacy Rails application that expose a RESTful API for a single page app, for example. Unfortunately, I can confirm that Controller specs do not appear to work in this setup, but feel free to have a go!

For more details about the story check the following blog post on tweetegy.com

Installation / Try this out at home

  1. Clone this repo to your own computer

  2. Run the following to install required gems (--path is optional)

bundle install --path vendor/bundle
  1. Run the following to setup the database:
RAILS_ENV=test bundle exec rake db:setup
  1. Run the following to see the specs pass!:
bundle exec rspec spec

About

Example Rails application to demonstrate using modern versions of RSpec and Capybara with older Rails

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published