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)
require 'spec_helper'
describe ArticlesController do
let(:article) { build_stubbed(:article) }
describe 'GET #index' do
before do
Article.stub all: [article]
get :index
end