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
e9f20f59
Commit
e9f20f59
authored
Apr 18, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-issue-dropzone' into 'master'
Fixed issue with dropzone not working on new issuable Closes #15295 See merge request !3760
parents
1c93b335
0be158a0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
2 deletions
+40
-2
_md_preview.html.haml
app/views/projects/_md_preview.html.haml
+1
-1
_form.html.haml
app/views/shared/issuable/_form.html.haml
+1
-1
issues_spec.rb
spec/features/issues_spec.rb
+38
-0
No files found.
app/views/projects/_md_preview.html.haml
View file @
e9f20f59
.md-area
.md-header
%ul
.nav-links
%ul
.nav-links
.clearfix
%li
.active
%a
.js-md-write-button
{
href:
"#md-write-holder"
,
tabindex:
-
1
}
Write
...
...
app/views/shared/issuable/_form.html.haml
View file @
e9f20f59
...
...
@@ -4,7 +4,7 @@
=
f
.
label
:title
,
class:
'control-label'
.col-sm-10
=
f
.
text_field
:title
,
maxlength:
255
,
autofocus:
true
,
autocomplete:
'off'
,
class:
'form-control pad
js-gfm-input
'
,
required:
true
class:
'form-control pad'
,
required:
true
-
if
issuable
.
is_a?
(
MergeRequest
)
%p
.help-block
...
...
spec/features/issues_spec.rb
View file @
e9f20f59
...
...
@@ -292,6 +292,23 @@ describe 'Issues', feature: true do
end
end
describe
'new issue'
do
context
'dropzone upload file'
,
js:
true
do
before
do
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
)
end
it
'should upload file when dragging into textarea'
do
drop_in_dropzone
test_image_file
# Wait for the file to upload
sleep
1
expect
(
page
.
find_field
(
"issue_description"
).
value
).
to
have_content
'banana_sample'
end
end
end
def
first_issue
page
.
all
(
'ul.issues-list > li'
).
first
.
text
end
...
...
@@ -299,4 +316,25 @@ describe 'Issues', feature: true do
def
last_issue
page
.
all
(
'ul.issues-list > li'
).
last
.
text
end
def
drop_in_dropzone
(
file_path
)
# Generate a fake input selector
page
.
execute_script
<<-
JS
var fakeFileInput = window.$('<input/>').attr(
{id: 'fakeFileInput', type: 'file'}
).appendTo('body');
JS
# Attach the file to the fake input selector with Capybara
attach_file
(
"fakeFileInput"
,
file_path
)
# Add the file to a fileList array and trigger the fake drop event
page
.
execute_script
<<-
JS
var fileList = [$('#fakeFileInput')[0].files[0]];
var e = jQuery.Event('drop', { dataTransfer : { files : fileList } });
$('.div-dropzone')[0].dropzone.listeners[0].events.drop(e);
JS
end
def
test_image_file
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
end
end
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