Skip to content

Instantly share code, notes, and snippets.

@jackdempsey
Created November 11, 2008 05:57
Show Gist options
  • Select an option

  • Save jackdempsey/23761 to your computer and use it in GitHub Desktop.

Select an option

Save jackdempsey/23761 to your computer and use it in GitHub Desktop.
def show
puts "in show with params #{params.inspect}"
@gist = Gist.get(params[:id])
puts "gist is #{@gist.inspect}"
raise NotFound unless @gist
display @gist
end
===============
describe "#show" do
it "should display an item when found" do
gist = Gist.create(:url => 'www.example.com')
request("/gists/#{gist.id}.json").should be_successful
end
it "should raise a NotFound when item is not found" do
@body = request("/gists/bad_id.json")
puts "the body is #{@body}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment