Ruby on Rails Thursday, July 29, 2010

Hi Fred,


Here is some code:
------------------

require 'test_helper'

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

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 via http://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