Skip to content

Commit ad0aa89

Browse files
committed
Add test for rails g annotate:install
1 parent c0fb949 commit ad0aa89

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

spec/integration/rails_6.0.2.1_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,20 @@
167167
end
168168
end
169169
end
170+
171+
describe 'rails g annotate:install' do
172+
let(:command) { 'bin/rails g annotate:install' }
173+
let(:rake_file_path) { 'lib/tasks/auto_annotate_models.rake' }
174+
175+
it 'generates the rake file' do
176+
Bundler.with_clean_env do
177+
Dir.chdir RAILS_6_0_APP_PATH do
178+
full_path = File.expand_path(rake_file_path)
179+
expect { `#{command}` }.to change { File.exist?(rake_file_path) }.from(false).to(true)
180+
181+
File.delete(full_path)
182+
end
183+
end
184+
end
185+
end
170186
end

0 commit comments

Comments
 (0)