Skip to content

Instantly share code, notes, and snippets.

Created August 7, 2009 10:22
Show Gist options
  • Save anonymous/163826 to your computer and use it in GitHub Desktop.
Save anonymous/163826 to your computer and use it in GitHub Desktop.
context "A user posting to a blog" do
setup do
@user = Factory(:user)
@blog = Factory(:blog)
end
action do
post :create, :user_id => @user.id, :id => @blog.id, :post => {:body => "Blah"}
end
# the body of this block is actually executed after 'setup' but before 'action'
expect "send a notification to Technorati or whatever" do
TechnoratiApi.expects(:notify)
end
should "put the post into the users's posts" do
@user.posts.include?("Blah") # or whatever
end
# etc
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment