Ruby on Rails Thursday, July 29, 2010

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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment