Judahmeek / rspec_vs_minitest

A comparison of Rspec & Minitest using Ashley Lewis's implementation of Hartl's tutorial

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ruby on Rails Tutorial: RSpec vs Minitest

To view RSpec version of this repository, visit https://github.com/Judahmeek/rspec_vs_minitest/tree/rspec

##Differences Between RSpec & Minitest The largest difference between Minitest & RSpec is RSpec's lack of a proper equivalent of assert_select.

I had to create some very brittle substring and regex matches to get those tests to pass, most notable in the User Profile Integration Examples

Capybara solves this issue, as demonstrated here (It's on my to-do list. lol): http://ruby-journal.com/how-to-write-rails-view-test-with-rspec/

##Fixtures vs Factories To keep the similarities between versions as close as possible, I used fixtures for RSpec instead of Factory_Girl. Both fixtures & factories have pros & cons, and I encourage readers to explore both sides of this issue: https://www.google.com/#q=factory+girl+vs+fixtures

However, if you're going to learn to use RSpec, then you should probably learn to use Factory_Girl & Capybara as well, since these three gems seem to be used together often.

Be warned that proper configuration of all three gems together may be non-trivial: http://brandonhilkert.com/blog/7-reasons-why-im-sticking-with-minitest-and-fixtures-in-rails/ (See reason 3)

##Special thanks to Michael Hartl This is the sample application for the Ruby on Rails Tutorial: Learn Web Development with Rails by Michael Hartl.

About

A comparison of Rspec & Minitest using Ashley Lewis's implementation of Hartl's tutorial


Languages

Language:Ruby 73.7%Language:HTML 18.0%Language:CSS 6.0%Language:CoffeeScript 1.5%Language:JavaScript 0.7%