Skip to content

Instantly share code, notes, and snippets.

View mplatts's full-sized avatar

Matt Platts mplatts

View GitHub Profile
@mplatts
mplatts / edit.html.erb_spec.rb
Created January 10, 2012 07:07
Rspec 2 Rails Samples
require 'spec_helper'
describe "cats/edit" do
before(:each) do
@cat = assign(:cat, stub_model(Cat,
:name => "MyString"
))
end
it "renders the edit cat form" do
@mplatts
mplatts / rspec-syntax-cheat-sheet.rb
Created January 9, 2012 23:59 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# Edited by webtempest.com
# ====================== Rails examples =====================
# ---------------------- Login Support -------------------------
module LoginSupport
# Fake a login for Controller specs
def fake_login_as(user)
@request.session[:user_id] = user ? user.id : nil
@mplatts
mplatts / gr
Created November 9, 2011 02:39
fg
rgregr