Skip to content

Instantly share code, notes, and snippets.

@metacritical
Created December 1, 2011 17:29
Show Gist options
  • Save metacritical/1418398 to your computer and use it in GitHub Desktop.
Save metacritical/1418398 to your computer and use it in GitHub Desktop.
Just A mock file
require 'spec_helper'
describe "Mock User object" do
let(:user) do
mock_model User, :find => "pankaj"
end
it "Should validate" do
#@user = User.find(1)
#User.find(:all)
user.find.should eq("pankaj")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment