diff options
Diffstat (limited to 'spec/lib/gitlab/changelog/config_spec.rb')
-rw-r--r-- | spec/lib/gitlab/changelog/config_spec.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/lib/gitlab/changelog/config_spec.rb b/spec/lib/gitlab/changelog/config_spec.rb index 2809843b832..a464c1e57e5 100644 --- a/spec/lib/gitlab/changelog/config_spec.rb +++ b/spec/lib/gitlab/changelog/config_spec.rb @@ -43,7 +43,7 @@ RSpec.describe Gitlab::Changelog::Config do expect(config.date_format).to eq('foo') expect(config.template) - .to be_instance_of(Gitlab::Changelog::AST::Expressions) + .to be_instance_of(Gitlab::TemplateParser::AST::Expressions) expect(config.categories).to eq({ 'foo' => 'bar' }) expect(config.tag_regex).to eq('foo') @@ -53,6 +53,16 @@ RSpec.describe Gitlab::Changelog::Config do expect { described_class.from_hash(project, 'categories' => 10) } .to raise_error(Gitlab::Changelog::Error) end + + it 'raises a Gitlab::Changelog::Error when the template is invalid' do + invalid_template = <<~TPL + {% each {{foo}} %} + {% end %} + TPL + + expect { described_class.from_hash(project, 'template' => invalid_template) } + .to raise_error(Gitlab::Changelog::Error) + end end describe '#contributor?' do |