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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
7dcaa682
Commit
7dcaa682
authored
Oct 06, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a spec for editing a file when a project was already forked
parent
a2dd511b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
spec/features/projects/user_edits_files_spec.rb
spec/features/projects/user_edits_files_spec.rb
+31
-1
No files found.
spec/features/projects/user_edits_files_spec.rb
View file @
7dcaa682
require
'spec_helper'
require
'spec_helper'
describe
'User edits files'
do
describe
'User edits files'
do
include
ProjectForksHelper
let
(
:project
)
{
create
(
:project
,
:repository
,
name:
'Shop'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
name:
'Shop'
)
}
let
(
:project2
)
{
create
(
:project
,
:repository
,
name:
'Another Project'
,
path:
'another-project'
)
}
let
(
:project2
)
{
create
(
:project
,
:repository
,
name:
'Another Project'
,
path:
'another-project'
)
}
let
(
:project_tree_path_root_ref
)
{
project_tree_path
(
project
,
project
.
repository
.
root_ref
)
}
let
(
:project_tree_path_root_ref
)
{
project_tree_path
(
project
,
project
.
repository
.
root_ref
)
}
...
@@ -122,7 +123,7 @@ describe 'User edits files' do
...
@@ -122,7 +123,7 @@ describe 'User edits files' do
fill_in
(
:commit_message
,
with:
'New commit message'
,
visible:
true
)
fill_in
(
:commit_message
,
with:
'New commit message'
,
visible:
true
)
click_button
(
'Commit changes'
)
click_button
(
'Commit changes'
)
fork
=
user
.
fork_of
(
project2
)
fork
=
user
.
fork_of
(
project2
.
reload
)
expect
(
current_path
).
to
eq
(
project_new_merge_request_path
(
fork
))
expect
(
current_path
).
to
eq
(
project_new_merge_request_path
(
fork
))
...
@@ -130,5 +131,34 @@ describe 'User edits files' do
...
@@ -130,5 +131,34 @@ describe 'User edits files' do
expect
(
page
).
to
have_content
(
'New commit message'
)
expect
(
page
).
to
have_content
(
'New commit message'
)
end
end
context
'when the user already had a fork of the project'
,
:js
do
let!
(
:forked_project
)
{
fork_project
(
project2
,
user
,
namespace:
user
.
namespace
,
repository:
true
)
}
before
do
visit
(
project2_tree_path_root_ref
)
end
it
'links to the forked project for editing'
do
click_link
(
'.gitignore'
)
find
(
'.js-edit-blob'
).
click
expect
(
page
).
not_to
have_link
(
'Fork'
)
expect
(
page
).
not_to
have_button
(
'Cancel'
)
execute_script
(
"ace.edit('editor').setValue('*.rbca')"
)
fill_in
(
:commit_message
,
with:
'Another commit'
,
visible:
true
)
click_button
(
'Commit changes'
)
fork
=
user
.
fork_of
(
project2
)
expect
(
current_path
).
to
eq
(
project_new_merge_request_path
(
fork
))
wait_for_requests
expect
(
page
).
to
have_content
(
'Another commit'
)
expect
(
page
).
to
have_content
(
"From
#{
forked_project
.
full_path
}
"
)
expect
(
page
).
to
have_content
(
"into
#{
project2
.
full_path
}
"
)
end
end
end
end
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