summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/changelog/config_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/changelog/config_spec.rb')
-rw-r--r--spec/lib/gitlab/changelog/config_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/gitlab/changelog/config_spec.rb b/spec/lib/gitlab/changelog/config_spec.rb
index 600682d30ad..92cad366cfd 100644
--- a/spec/lib/gitlab/changelog/config_spec.rb
+++ b/spec/lib/gitlab/changelog/config_spec.rb
@@ -20,6 +20,18 @@ RSpec.describe Gitlab::Changelog::Config do
described_class.from_git(project)
end
+ it "retrieves the specified configuration from git" do
+ allow(project.repository)
+ .to receive(:changelog_config).with('HEAD', 'specified_changelog_config.yml')
+ .and_return("---\ndate_format: '%Y'")
+
+ expect(described_class)
+ .to receive(:from_hash)
+ .with(project, { 'date_format' => '%Y' }, nil)
+
+ described_class.from_git(project, nil, 'specified_changelog_config.yml')
+ end
+
it 'returns the default configuration when no YAML file exists in Git' do
allow(project.repository)
.to receive(:changelog_config)