1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Added a test case for Devise Generator

This commit is contained in:
Vinicius Baggio 2011-02-23 11:18:56 -03:00
parent 970457f2c2
commit 6bd65209d5

View file

@ -0,0 +1,27 @@
require 'test_helper'
require "generators/devise/devise_generator"
class DeviseGeneratorTest < Rails::Generators::TestCase
tests Devise::Generators::DeviseGenerator
destination File.expand_path("../../tmp", __FILE__)
setup do
prepare_destination
copy_routes
end
test "route generation for simple model names" do
run_generator %w(monster name:string)
assert_file "config/routes.rb", /devise_for :monsters/
end
def copy_routes
routes = File.expand_path("../../rails_app/config/routes.rb", __FILE__)
destination = File.join(destination_root, "config")
FileUtils.mkdir_p(destination)
FileUtils.cp routes, destination
end
end