Permalink
Browse files

Fix testing with rails 3.

  • Loading branch information...
1 parent 0f4c591 commit 376d7637ab5bb51dc649b6bf40c241946f4482be @neglectedvalue committed May 26, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 test/environment.rb
View
@@ -35,7 +35,11 @@ def self.with_model options = {}
has_ancestry options unless options.delete(:skip_ancestry)
def self.model_name
- Struct.new(:human, :underscore).new 'TestNode', 'test_node'
+ if rails_3
+ ActiveModel::Name.new(TestNode)
+ else
+ Struct.new(:human, :underscore).new('TestNode', 'test_node')
+ end
end
private

0 comments on commit 376d763

Please sign in to comment.