diff options
author | Toon Claes <toon@gitlab.com> | 2019-07-04 21:47:16 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-07-04 21:47:16 +0300 |
commit | 37e4d6d991ac8e712ea99c621f98831955b6ebf5 (patch) | |
tree | 75d76059e5df9d9b3c5622aa6dad0344dc9cc42f /spec | |
parent | 507dfc66b480c0df097daefe86bf3a6bb3b2210f (diff) |
DRY up conditions for files require DB review
Stop using two separate lists for the conditions which files require a
database review.
Related discussion:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/30156#note_187732053
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/danger/helper_spec.rb | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/spec/lib/gitlab/danger/helper_spec.rb b/spec/lib/gitlab/danger/helper_spec.rb index c8e65a3e59d..92d90ac2fef 100644 --- a/spec/lib/gitlab/danger/helper_spec.rb +++ b/spec/lib/gitlab/danger/helper_spec.rb @@ -87,13 +87,13 @@ describe Gitlab::Danger::Helper do describe '#changes_by_category' do it 'categorizes changed files' do - expect(fake_git).to receive(:added_files) { %w[foo foo.md foo.rb foo.js db/foo qa/foo ee/changelogs/foo.yml] } + expect(fake_git).to receive(:added_files) { %w[foo foo.md foo.rb foo.js db/foo lib/gitlab/database/foo.rb qa/foo ee/changelogs/foo.yml] } allow(fake_git).to receive(:modified_files) { [] } allow(fake_git).to receive(:renamed_files) { [] } expect(helper.changes_by_category).to eq( backend: %w[foo.rb], - database: %w[db/foo], + database: %w[db/foo lib/gitlab/database/foo.rb], frontend: %w[foo.js], none: %w[ee/changelogs/foo.yml foo.md], qa: %w[qa/foo], @@ -159,9 +159,22 @@ describe Gitlab::Danger::Helper do 'ee/FOO_VERSION' | :unknown - 'db/foo' | :database - 'qa/foo' | :qa + 'db/foo' | :database + 'ee/db/foo' | :database + 'app/models/project_authorization.rb' | :database + 'app/services/users/refresh_authorized_projects_service.rb' | :database + 'lib/gitlab/background_migration.rb' | :database + 'lib/gitlab/background_migration/foo' | :database + 'ee/lib/gitlab/background_migration/foo' | :database + 'lib/gitlab/database.rb' | :database + 'lib/gitlab/database/foo' | :database + 'ee/lib/gitlab/database/foo' | :database + 'lib/gitlab/github_import.rb' | :database + 'lib/gitlab/github_import/foo' | :database + 'lib/gitlab/sql/foo' | :database + 'rubocop/cop/migration/foo' | :database + 'qa/foo' | :qa 'ee/qa/foo' | :qa 'changelogs/foo' | :none |