Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
b5f2a7e1
Commit
b5f2a7e1
authored
May 02, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed integration test
parent
07ab6c2e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
23 deletions
+12
-23
spec/features/projects/import_export/import_file_spec.rb
spec/features/projects/import_export/import_file_spec.rb
+12
-23
No files found.
spec/features/projects/import_export/import_file_spec.rb
View file @
b5f2a7e1
...
...
@@ -6,14 +6,19 @@ feature 'project import', feature: true, js: true do
let
(
:user
)
{
create
(
:admin
)
}
let!
(
:namespace
)
{
create
(
:namespace
,
name:
"asd"
,
owner:
user
)
}
let
(
:file
)
{
File
.
join
(
Rails
.
root
,
'spec'
,
'features'
,
'projects'
,
'import_export'
,
'test_project_export.tar.gz'
)
}
let
(
:export_path
)
{
"
#{
Dir
::
tmpdir
}
/import_file_spec"
}
background
do
export_path
=
"
#{
Dir
::
tmpdir
}
/import_file_spec"
allow_any_instance_of
(
Gitlab
::
ImportExport
).
to
receive
(
:storage_path
).
and_return
(
export_path
)
login_as
(
user
)
end
after
(
:each
)
do
FileUtils
.
rm_rf
(
export_path
,
secure:
true
)
end
scenario
'user imports an exported project successfully'
do
expect
(
Project
.
all
.
count
).
to
be_zero
visit
new_project_path
select2
(
'2'
,
from:
'#project_namespace_id'
)
...
...
@@ -22,29 +27,13 @@ feature 'project import', feature: true, js: true do
expect
(
page
).
to
have_content
(
'GitLab export file'
)
expect
(
URI
.
parse
(
current_url
).
query
).
to
eq
(
'namespace_id=2&path=test-project-path'
)
attach_file
(
'file'
,
file
)
#TODO check timings
sleep
1
attach_file
(
'file'
,
file
)
click_on
'Continue to the next step'
end
click_on
'Continue to the next step'
# import starts
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
expect
(
Project
.
last
).
not_to
be_nil
expect
(
Project
.
last
.
issues
).
not_to
be_empty
expect
(
Project
.
last
.
repo_exists?
).
to
be
true
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