diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-12-29 15:46:12 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-12-29 15:46:12 -0800 |
commit | b27a3e8da39484d8a02d3b9c1e4dc3cb60ddcce7 (patch) | |
tree | 372a4af6df43eb8bed19c11e55b2f70907d60507 /railties/test/plugins | |
parent | ada895e8cac855a2f248aafdb92457365f062d07 (diff) | |
parent | b354496bda901cb0af499d6f3dff17a96a834a67 (diff) | |
download | rails-b27a3e8da39484d8a02d3b9c1e4dc3cb60ddcce7.tar.gz rails-b27a3e8da39484d8a02d3b9c1e4dc3cb60ddcce7.tar.bz2 rails-b27a3e8da39484d8a02d3b9c1e4dc3cb60ddcce7.zip |
Merge branch 'master' of git://github.com/mikel/rails into mail
Conflicts:
actionmailer/lib/action_mailer.rb
Diffstat (limited to 'railties/test/plugins')
-rw-r--r-- | railties/test/plugins/configuration_test.rb | 36 | ||||
-rw-r--r-- | railties/test/plugins/framework_extension_test.rb | 18 |
2 files changed, 54 insertions, 0 deletions
diff --git a/railties/test/plugins/configuration_test.rb b/railties/test/plugins/configuration_test.rb new file mode 100644 index 0000000000..5786316d1d --- /dev/null +++ b/railties/test/plugins/configuration_test.rb @@ -0,0 +1,36 @@ +require "isolation/abstract_unit" + +module PluginsTest + class ConfigurationTest < Test::Unit::TestCase + def setup + build_app + boot_rails + require "rails" + end + + test "config is available to plugins" do + class Foo < Rails::Plugin ; end + assert_nil Foo.config.action_controller.foo + end + + test "a config name is available for the plugin" do + class Foo < Rails::Plugin ; config.foo.greetings = "hello" ; end + assert_equal "hello", Foo.config.foo.greetings + end + + test "plugin configurations are available in the application" do + class Foo < Rails::Plugin ; config.foo.greetings = "hello" ; end + require "#{app_path}/config/application" + assert_equal "hello", AppTemplate::Application.config.foo.greetings + end + + test "plugin config merges are deep" do + class Foo < Rails::Plugin ; config.foo.greetings = 'hello' ; end + class MyApp < Rails::Application + config.foo.bar = "bar" + end + assert_equal "hello", MyApp.config.foo.greetings + assert_equal "bar", MyApp.config.foo.bar + end + end +end diff --git a/railties/test/plugins/framework_extension_test.rb b/railties/test/plugins/framework_extension_test.rb new file mode 100644 index 0000000000..87e19cadce --- /dev/null +++ b/railties/test/plugins/framework_extension_test.rb @@ -0,0 +1,18 @@ +require "isolation/abstract_unit" + +module PluginsTest + class FrameworkExtensionTest < Test::Unit::TestCase + def setup + build_app + boot_rails + end + + test "active_record extensions are applied to ActiveRecord" do + add_to_config "config.active_record.table_name_prefix = 'tbl_'" + + require "#{app_path}/config/environment" + + assert_equal 'tbl_', ActiveRecord::Base.table_name_prefix + end + end +end
\ No newline at end of file |