Skip to content

Commit c0fb949

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

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

spec/integration/rails_5.2.4.1_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,20 @@
152152
end
153153
end
154154
end
155+
156+
describe 'rails g annotate:install' do
157+
let(:command) { 'bin/rails g annotate:install' }
158+
let(:rake_file_path) { 'lib/tasks/auto_annotate_models.rake' }
159+
160+
it 'generates the rake file' do
161+
Bundler.with_clean_env do
162+
Dir.chdir RAILS_5_2_APP_PATH do
163+
full_path = File.expand_path(rake_file_path)
164+
expect { `#{command}` }.to change { File.exist?(rake_file_path) }.from(false).to(true)
165+
166+
File.delete(full_path)
167+
end
168+
end
169+
end
170+
end
155171
end

0 commit comments

Comments
 (0)