handle namespaced models in AR generator

closes #2043
This commit is contained in:
Vasiliy Ermolovich
2012-10-28 00:58:24 +03:00
parent 90dbae4c7a
commit 2f36d0dd32
2 changed files with 12 additions and 2 deletions

View File

@@ -14,6 +14,12 @@ if DEVISE_ORM == :active_record
assert_migration "db/migrate/devise_create_monsters.rb", /def change/
end
test "all files for namespaced model are properly created" do
run_generator %w(admin/monster)
assert_file "app/models/admin/monster.rb", /devise/, /attr_accessible (:[a-z_]+(, )?)+/
assert_migration "db/migrate/devise_create_admin_monsters.rb", /def change/
end
test "update model migration when model exists" do
run_generator %w(monster)
assert_file "app/models/monster.rb"
@@ -66,4 +72,4 @@ if DEVISE_ORM == :active_record
end
end
end
end
end