Skip to content

Instantly share code, notes, and snippets.

@bclennox
Created January 24, 2009 04:29
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 bclennox/51334 to your computer and use it in GitHub Desktop.
Save bclennox/51334 to your computer and use it in GitHub Desktop.
describe ChildrenController
belongs_to :parent
describe "GET :index" do
before(:each) do
@children = stub_index(Child)
end
it_should_find_and_assign :children
it_should_render_template "index"
end
describe "GET :new" do
before(:each) do
@child = stub_new(Child)
end
it_should_initialize_and_assign :child
it_should_render_template "new"
end
describe "GET :edit" do
before(:each) do
@child = stub_edit(Child)
end
it_should_find_and_assign :child
it_should_render_template "edit"
end
# ... and so forth ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment