]> source.dussan.org Git - redmine.git/commitdiff
Rails3: :order option has no effect here because of the default_scope on Enumeration.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 4 Mar 2012 12:50:19 +0000 (12:50 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 4 Mar 2012 12:50:19 +0000 (12:50 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9084 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/enumerations_controller_test.rb

index ee783ab9c92819c1ca8fc4fed2ef8e3d0d893be7..4b203a4dda32d01e6edc02d6c2ee17ab62dcd867 100644 (file)
@@ -49,8 +49,8 @@ class EnumerationsControllerTest < ActionController::TestCase
       post :create, :enumeration => {:type => 'IssuePriority', :name => 'Lowest'}
     end
     assert_redirected_to '/enumerations?type=IssuePriority'
-    e = IssuePriority.first(:order => 'id DESC')
-    assert_equal 'Lowest', e.name
+    e = IssuePriority.find_by_name('Lowest')
+    assert_not_nil e
   end
 
   def test_create_with_failure