Skip to content

Instantly share code, notes, and snippets.

View fairweatherfan's full-sized avatar

fairweatherfan

View GitHub Profile
@fairweatherfan
fairweatherfan / games_controller_spec.rb
Created January 26, 2014 02:39
GamesController Spec
require 'spec_helper'
describe GamesController do
describe 'GET#index' do
before do
@fake_games = [ double('game1'), double('game2'), double('game3') ]
end
it 'gets all games' do
Game.should_receive(:all).and_return(@fake_games)
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")