On Jul 29, 5:23 pm, Fernando Perez <li...@ruby-forum. > > class Admin::OrdersControllerTest < ActionController::TestCase > > def setup > @controller = Admin::OrdersController.new > @request = ActionController::TestRequest.new > @response = ActionController::TestResponse.new > @controller.expects(:admin?).at_least_once.returns(true) > @order = Factory.order > end
Do you explicitly require mocha somewhere? By the way you no longer need to setup @controller/@request/@response - actioncontroller::testcase does that for you Fred Fred > > def test_index > get :index > assert_response :success > end > end > > And here is the error message: > ------------------------------ > > 1) Error: > test_index(Admin::OrdersControllerTest): > NoMethodError: undefined method `expects' for > #<Admin::OrdersController:0x229a32c @real_format=nil> > -- > Posted viahttp://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

