Skip to content

Instantly share code, notes, and snippets.

@caged
Created January 18, 2009 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caged/48499 to your computer and use it in GitHub Desktop.
Save caged/48499 to your computer and use it in GitHub Desktop.
describe "Users Controller", "find_recent action" do
it "should find all users who've been active in the last 24 hours" do
@users = mock("A list of users")
User.should_receive(:find_all).with(24).and_return(@users)
c, r = request("/users/find_recent/24")
c.body.should eql(@users.to_json) # Where is the to_json method coming from? Will it actually contain any data?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment