Skip to content

Commit

Permalink
Add integration test for rails g annotate:install (ctran#783)
Browse files Browse the repository at this point in the history
Add integration test that calls on rails generator.
  • Loading branch information
drwl authored and vfonic committed May 8, 2020
1 parent 443000d commit 43ef743
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/integration/rails_5.2.4.1_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions spec/integration/rails_6.0.2.1_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 43ef743

Please sign in to comment.