From d475de7e2573847bf4b13c291618053f30070a21 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Sun, 19 Sep 2010 17:21:16 +0200 Subject: Add helper for loading seed data for engine and application MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- railties/test/railties/engine_test.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'railties/test') diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 1d9587cadb..a9dd7d4c1b 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -624,5 +624,24 @@ module RailtiesTest assert !File.exist?(File.join(app_path, 'public/bukkits')) end end + + test "loading seed data" do + @plugin.write "db/seeds.rb", <<-RUBY + Bukkits::Engine.config.bukkits_seeds_loaded = true + RUBY + + app_file "db/seeds.rb", <<-RUBY + Rails.application.config.app_seeds_loaded = true + RUBY + + boot_rails + + Rails.application.load_seed + assert Rails.application.config.app_seeds_loaded + assert_raise(NoMethodError) do Bukkits::Engine.config.bukkits_seeds_loaded end + + Bukkits::Engine.load_seed + assert Bukkits::Engine.config.bukkits_seeds_loaded + end end end -- cgit v1.2.3