diff --git a/spec/integration/rails_5.2.4.1_spec.rb b/spec/integration/rails_5.2.4.1_spec.rb index f2957d6dd..06a62cea7 100644 --- a/spec/integration/rails_5.2.4.1_spec.rb +++ b/spec/integration/rails_5.2.4.1_spec.rb @@ -152,4 +152,20 @@ end end end + + describe 'rails g annotate:install' do + let(:command) { 'bin/rails g annotate:install' } + let(:rake_file_path) { 'lib/tasks/auto_annotate_models.rake' } + + it 'generates the rake file' do + Bundler.with_clean_env do + Dir.chdir RAILS_5_2_APP_PATH do + full_path = File.expand_path(rake_file_path) + expect { `#{command}` }.to change { File.exist?(rake_file_path) }.from(false).to(true) + + File.delete(full_path) + end + end + end + end end diff --git a/spec/integration/rails_6.0.2.1_spec.rb b/spec/integration/rails_6.0.2.1_spec.rb index 4622bfe41..d5161693f 100644 --- a/spec/integration/rails_6.0.2.1_spec.rb +++ b/spec/integration/rails_6.0.2.1_spec.rb @@ -167,4 +167,20 @@ end end end + + describe 'rails g annotate:install' do + let(:command) { 'bin/rails g annotate:install' } + let(:rake_file_path) { 'lib/tasks/auto_annotate_models.rake' } + + it 'generates the rake file' do + Bundler.with_clean_env do + Dir.chdir RAILS_6_0_APP_PATH do + full_path = File.expand_path(rake_file_path) + expect { `#{command}` }.to change { File.exist?(rake_file_path) }.from(false).to(true) + + File.delete(full_path) + end + end + end + end end