module Shoulda::Context::DSL::ClassMethods
def before_should(name, &blk)
end
end
end
User.expects(:find).with(:all).returns(@users)
before_should "find all users" do
# runs before "get :index"
should respond_with(:success)
setup { get :index }
context "on GET" do
end
User.stubs(:find).returns(@users)
@users = [Factory(:user)]
setup do
context "the index action" do
class UserControllerTest < Test::Unit::TestCase
=== Example:
context's setup. These are especially useful when setting expectations.
Before statements are should statements that run before the current
== Before statements
def before_should(name, &blk) should(name, :before => blk) { assert true } end