BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
ebdea371
Unverified
Commit
ebdea371
authored
Jan 04, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix remove template
parent
115aac77
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
13 deletions
+10
-13
issuable_template_selector.js.es6
...s/javascripts/templates/issuable_template_selector.js.es6
+1
-1
issuable_templates_spec.rb
spec/features/projects/issuable_templates_spec.rb
+9
-12
No files found.
app/assets/javascripts/templates/issuable_template_selector.js.es6
View file @
ebdea371
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
});
});
$('.no-template', this.dropdown.parent()).on('click', () => {
$('.no-template', this.dropdown.parent()).on('click', () => {
this.currentTemplate = '';
this.currentTemplate
.content
= '';
this.setInputValueToTemplateContent();
this.setInputValueToTemplateContent();
$('.dropdown-toggle-text', this.dropdown).text('Choose a template');
$('.dropdown-toggle-text', this.dropdown).text('Choose a template');
});
});
...
...
spec/features/projects/issuable_templates_spec.rb
View file @
ebdea371
...
@@ -27,7 +27,7 @@ feature 'issuable templates', feature: true, js: true do
...
@@ -27,7 +27,7 @@ feature 'issuable templates', feature: true, js: true do
scenario
'user selects "bug" template'
do
scenario
'user selects "bug" template'
do
select_template
'bug'
select_template
'bug'
wait_for_ajax
wait_for_ajax
preview
_template
assert
_template
save_changes
save_changes
end
end
...
@@ -35,8 +35,7 @@ feature 'issuable templates', feature: true, js: true do
...
@@ -35,8 +35,7 @@ feature 'issuable templates', feature: true, js: true do
select_template
'bug'
select_template
'bug'
wait_for_ajax
wait_for_ajax
select_option
'No template'
select_option
'No template'
wait_for_ajax
assert_template
(
''
)
preview_template
(
''
)
save_changes
(
''
)
save_changes
(
''
)
end
end
...
@@ -44,9 +43,9 @@ feature 'issuable templates', feature: true, js: true do
...
@@ -44,9 +43,9 @@ feature 'issuable templates', feature: true, js: true do
select_template
'bug'
select_template
'bug'
wait_for_ajax
wait_for_ajax
find_field
(
'issue_description'
).
send_keys
(
description_addition
)
find_field
(
'issue_description'
).
send_keys
(
description_addition
)
preview
_template
(
template_content
+
description_addition
)
assert
_template
(
template_content
+
description_addition
)
select_option
'Reset template'
select_option
'Reset template'
preview
_template
assert
_template
save_changes
save_changes
end
end
...
@@ -77,7 +76,7 @@ feature 'issuable templates', feature: true, js: true do
...
@@ -77,7 +76,7 @@ feature 'issuable templates', feature: true, js: true do
scenario
'user selects "bug" template'
do
scenario
'user selects "bug" template'
do
select_template
'bug'
select_template
'bug'
wait_for_ajax
wait_for_ajax
preview
_template
(
"
#{
template_content
}
"
)
assert
_template
(
"
#{
template_content
}
"
)
save_changes
save_changes
end
end
end
end
...
@@ -95,7 +94,7 @@ feature 'issuable templates', feature: true, js: true do
...
@@ -95,7 +94,7 @@ feature 'issuable templates', feature: true, js: true do
scenario
'user selects "feature-proposal" template'
do
scenario
'user selects "feature-proposal" template'
do
select_template
'feature-proposal'
select_template
'feature-proposal'
wait_for_ajax
wait_for_ajax
preview
_template
assert
_template
save_changes
save_changes
end
end
end
end
...
@@ -122,17 +121,15 @@ feature 'issuable templates', feature: true, js: true do
...
@@ -122,17 +121,15 @@ feature 'issuable templates', feature: true, js: true do
scenario
'user selects template'
do
scenario
'user selects template'
do
select_template
'feature-proposal'
select_template
'feature-proposal'
wait_for_ajax
wait_for_ajax
preview
_template
assert
_template
save_changes
save_changes
end
end
end
end
end
end
end
end
def
preview_template
(
expected_content
=
template_content
)
def
assert_template
(
expected_content
=
template_content
)
click_link
'Preview'
expect
(
find
(
'textarea'
)[
'value'
]).
to
eq
(
expected_content
)
expect
(
page
).
to
have_content
expected_content
click_link
'Write'
end
end
def
save_changes
(
expected_content
=
template_content
)
def
save_changes
(
expected_content
=
template_content
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment