diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-10-12 16:48:31 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-10-13 15:38:27 +0300 |
commit | 3a78e96e55b3428d7faa80edf140f3bd87566f74 (patch) | |
tree | df9c3e3d1e969de439605578e101772b9a364e91 /spec | |
parent | cc411c7145f07cb68c33b3576ec9bd3031626ceb (diff) |
Merge branch 'cache-issuable-template-names' into 'master'
Cache issuable template names
See merge request gitlab-org/gitlab-ce!14823
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/file_detector_spec.rb | 12 | ||||
-rw-r--r-- | spec/models/repository_spec.rb | 4 |
2 files changed, 15 insertions, 1 deletions
diff --git a/spec/lib/gitlab/file_detector_spec.rb b/spec/lib/gitlab/file_detector_spec.rb index 695fd6f8573..8e524f9b05a 100644 --- a/spec/lib/gitlab/file_detector_spec.rb +++ b/spec/lib/gitlab/file_detector_spec.rb @@ -18,6 +18,10 @@ describe Gitlab::FileDetector do expect(described_class.type_of('README.md')).to eq(:readme) end + it 'returns nil for a README file in a directory' do + expect(described_class.type_of('foo/README.md')).to be_nil + end + it 'returns the type of a changelog file' do %w(CHANGELOG HISTORY CHANGES NEWS).each do |file| expect(described_class.type_of(file)).to eq(:changelog) @@ -52,6 +56,14 @@ describe Gitlab::FileDetector do end end + it 'returns the type of an issue template' do + expect(described_class.type_of('.gitlab/issue_templates/foo.md')).to eq(:issue_template) + end + + it 'returns the type of a merge request template' do + expect(described_class.type_of('.gitlab/merge_request_templates/foo.md')).to eq(:merge_request_template) + end + it 'returns nil for an unknown file' do expect(described_class.type_of('foo.txt')).to be_nil end diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 5d78aed5b4f..f44693a71bb 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -1509,7 +1509,9 @@ describe Repository do :gitignore, :koding, :gitlab_ci, - :avatar + :avatar, + :issue_template, + :merge_request_template ]) repository.after_change_head |