Permalink
Browse files

Change test engine definition, so it works in Rails 3.1

::use_relative_model_naming? was introduced in Rails 3.2, so this setup wasn't working for 3.1. Normal engine definition is compatible across all versions.
  • Loading branch information...
spectator committed Mar 1, 2013
1 parent 6bee9e0 commit 498bb45765575f9d4362ceee7043e6fdef84081f
Showing with 5 additions and 6 deletions.
  1. +1 −1 test/collection_responder_test.rb
  2. +4 −5 test/test_helper.rb
@@ -28,7 +28,7 @@ def with_location
end
def isolated_namespace
- respond_with MyEngine::Business.new
+ respond_with MyEngine::Business
end
def uncountable
View
@@ -11,6 +11,7 @@
require 'active_support'
require 'action_controller'
require 'active_model'
+require 'rails/engine'
require 'rails/railtie'
$:.unshift File.expand_path('../../lib', __FILE__)
@@ -70,10 +71,8 @@ class News < Model
end
module MyEngine
- def self.use_relative_model_naming?
- true
- end
-
- class Business < Model
+ class Business < Rails::Engine
+ isolate_namespace MyEngine
+ extend ActiveModel::Naming
end
end

0 comments on commit 498bb45

Please sign in to comment.