Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/issuable_templates_spec.rb')
-rw-r--r--spec/features/projects/issuable_templates_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/features/projects/issuable_templates_spec.rb b/spec/features/projects/issuable_templates_spec.rb
index 12c5820a69d..ac83de3e765 100644
--- a/spec/features/projects/issuable_templates_spec.rb
+++ b/spec/features/projects/issuable_templates_spec.rb
@@ -90,6 +90,34 @@ RSpec.describe 'issuable templates', :js do
end
end
+ context 'user creates an issue with a default template from the repo' do
+ let(:template_content) { 'this is the default template' }
+
+ before do
+ project.repository.create_file(
+ user,
+ '.gitlab/issue_templates/default.md',
+ template_content,
+ message: 'added default issue template',
+ branch_name: 'master'
+ )
+ end
+
+ it 'does not overwrite autosaved description' do
+ visit new_project_issue_path project
+ wait_for_requests
+
+ assert_template # default template is loaded the first time
+
+ fill_in 'issue_description', with: 'my own description', fill_options: { clear: :backspace }
+
+ visit new_project_issue_path project
+ wait_for_requests
+
+ assert_template(expected_content: 'my own description')
+ end
+ end
+
context 'user creates a merge request using templates' do
let(:template_content) { 'this is a test "feature-proposal" template' }
let(:bug_template_content) { 'this is merge request bug template' }