mirror of
				https://github.com/heartcombo/devise.git
				synced 2022-11-09 12:18:31 -05:00 
			
		
		
		
	* Expand the explanation of why it fail. * Raise a subclass of `Thor::Error` so the Thor doesn't output the exception backtrace as it isn't useful for developers facing this error.
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			715 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			715 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
require "test_helper"
 | 
						|
 | 
						|
class InstallGeneratorTest < Rails::Generators::TestCase
 | 
						|
  tests Devise::Generators::InstallGenerator
 | 
						|
  destination File.expand_path("../../tmp", __FILE__)
 | 
						|
  setup :prepare_destination
 | 
						|
 | 
						|
  test "assert all files are properly created" do
 | 
						|
    run_generator(["--orm=active_record"])
 | 
						|
    assert_file "config/initializers/devise.rb", /devise\/orm\/active_record/
 | 
						|
    assert_file "config/locales/devise.en.yml"
 | 
						|
  end
 | 
						|
 | 
						|
  test "fails if no ORM is specified" do
 | 
						|
    stderr = capture(:stderr) do
 | 
						|
      run_generator
 | 
						|
    end
 | 
						|
 | 
						|
    assert_match %r{An ORM must be set to install Devise}, stderr
 | 
						|
 | 
						|
    assert_no_file "config/initializers/devise.rb"
 | 
						|
    assert_no_file "config/locales/devise.en.yml"
 | 
						|
  end
 | 
						|
end
 |