Skip to content

Instantly share code, notes, and snippets.

@jpoz
Created March 19, 2009 22:58
Show Gist options
  • Save jpoz/82117 to your computer and use it in GitHub Desktop.
Save jpoz/82117 to your computer and use it in GitHub Desktop.
before(:each) do
user = Factory.create(:user, :email => "younotcookin@snakebarf.com")
login_as(user)
@redis = mock("Redis", :null_object => true)
Redis.stub!(:new).and_return(@redis)
end
it "should add the params to a list for the current user" do
@redis.should_receive(:new)
get :index, :params => {}
end
==== controller ===
after_filter :log_params
def log_params
r = Redis.new
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment