Greetings
I'm converting an rails 2 app to rails 3 and am having a time trying to
update tests on some named_scopes.  I've search and searched and cannot
find anything that explains what I need to do.  We are not using rspec
so I need to know if there is another way to convert these named scopes.

The problem seems to be with the proxy_options.

My Test:

class ClassInstructorTest < ActiveSupport::TestCase
  test "named_scope :find_instructor_for_a_course" do
    expected = { :select => "instr_id, netid",
              :conditions => ["crs_no = ? AND
                               term = ? AND
                               class_type = ? AND
                               class_no = ?", 'HA5503', 'F10', 'LEC', 1]
}
    assert_equal expected,
ClassInstructor.find_instructor_for_a_course('HA5503', 'F10', 'LEC',
1).proxy_options
   end
end

I get the following error when running my test:

1) Error:
test_named_scope_:find_instructor_for_a_course(ClassInstructorTest):
NoMethodError: undefined method `proxy_options' for [#<ClassInstructor
instr_id: "SMITH", netid: "hms25">]:ActiveRecord::Relation
    /test/unit/class_instructor_test.rb:10:in
`test_named_scope_:find_instructor_for_a_course'

Can anyone show me how to rewrite this test?
Thanks in advance.
--jc

-- 
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 [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.

Reply via email to