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
ae7c52a0
Commit
ae7c52a0
authored
Aug 11, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more tests
parent
41a5adca
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
120 additions
and
119 deletions
+120
-119
spec/controllers/projects/issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+2
-0
spec/features/merge_requests/filter_merge_requests_spec.rb
spec/features/merge_requests/filter_merge_requests_spec.rb
+6
-6
spec/features/merge_requests/reset_filters_spec.rb
spec/features/merge_requests/reset_filters_spec.rb
+3
-3
spec/features/task_lists_spec.rb
spec/features/task_lists_spec.rb
+4
-0
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+97
-106
spec/services/create_deployment_service_spec.rb
spec/services/create_deployment_service_spec.rb
+4
-0
spec/services/merge_requests/get_urls_service_spec.rb
spec/services/merge_requests/get_urls_service_spec.rb
+4
-4
No files found.
spec/controllers/projects/issues_controller_spec.rb
View file @
ae7c52a0
...
@@ -858,6 +858,8 @@ describe Projects::IssuesController do
...
@@ -858,6 +858,8 @@ describe Projects::IssuesController do
before
do
before
do
project
.
add_developer
(
user
)
project
.
add_developer
(
user
)
sign_in
(
user
)
sign_in
(
user
)
allow_any_instance_of
(
MergeRequest
).
to
receive
(
:write_ref
)
end
end
it
'creates a new merge request'
do
it
'creates a new merge request'
do
...
...
spec/features/merge_requests/filter_merge_requests_spec.rb
View file @
ae7c52a0
...
@@ -12,7 +12,7 @@ describe 'Filter merge requests' do
...
@@ -12,7 +12,7 @@ describe 'Filter merge requests' do
let!
(
:wontfix
)
{
create
(
:label
,
project:
project
,
title:
"Won't fix"
)
}
let!
(
:wontfix
)
{
create
(
:label
,
project:
project
,
title:
"Won't fix"
)
}
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
add_master
(
user
)
group
.
add_developer
(
user
)
group
.
add_developer
(
user
)
sign_in
(
user
)
sign_in
(
user
)
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
...
@@ -170,7 +170,7 @@ describe 'Filter merge requests' do
...
@@ -170,7 +170,7 @@ describe 'Filter merge requests' do
describe
'filter merge requests by text'
do
describe
'filter merge requests by text'
do
before
do
before
do
create
(
:merge_request
,
title:
"Bug"
,
source_project:
project
,
target_project:
project
,
source_branch:
"
bug
"
)
create
(
:merge_request
,
title:
"Bug"
,
source_project:
project
,
target_project:
project
,
source_branch:
"
wip
"
)
bug_label
=
create
(
:label
,
project:
project
,
title:
'bug'
)
bug_label
=
create
(
:label
,
project:
project
,
title:
'bug'
)
milestone
=
create
(
:milestone
,
title:
"8"
,
project:
project
)
milestone
=
create
(
:milestone
,
title:
"8"
,
project:
project
)
...
@@ -179,7 +179,7 @@ describe 'Filter merge requests' do
...
@@ -179,7 +179,7 @@ describe 'Filter merge requests' do
title:
"Bug 2"
,
title:
"Bug 2"
,
source_project:
project
,
source_project:
project
,
target_project:
project
,
target_project:
project
,
source_branch:
"
bug2
"
,
source_branch:
"
fix
"
,
milestone:
milestone
,
milestone:
milestone
,
author:
user
,
author:
user
,
assignee:
user
)
assignee:
user
)
...
@@ -259,12 +259,12 @@ describe 'Filter merge requests' do
...
@@ -259,12 +259,12 @@ describe 'Filter merge requests' do
end
end
end
end
describe
'filter merge requests and sort'
,
js:
true
do
describe
'filter merge requests and sort'
,
:js
do
before
do
before
do
bug_label
=
create
(
:label
,
project:
project
,
title:
'bug'
)
bug_label
=
create
(
:label
,
project:
project
,
title:
'bug'
)
mr1
=
create
(
:merge_request
,
title:
"Frontend"
,
source_project:
project
,
target_project:
project
,
source_branch:
"
Frontend
"
)
mr1
=
create
(
:merge_request
,
title:
"Frontend"
,
source_project:
project
,
target_project:
project
,
source_branch:
"
wip
"
)
mr2
=
create
(
:merge_request
,
title:
"Bug 2"
,
source_project:
project
,
target_project:
project
,
source_branch:
"
bug2
"
)
mr2
=
create
(
:merge_request
,
title:
"Bug 2"
,
source_project:
project
,
target_project:
project
,
source_branch:
"
fix
"
)
mr1
.
labels
<<
bug_label
mr1
.
labels
<<
bug_label
mr2
.
labels
<<
bug_label
mr2
.
labels
<<
bug_label
...
...
spec/features/merge_requests/reset_filters_spec.rb
View file @
ae7c52a0
require
'rails_helper'
require
'rails_helper'
feature
'Merge requests filter clear button'
,
js:
true
do
feature
'Merge requests filter clear button'
,
:js
do
include
FilteredSearchHelpers
include
FilteredSearchHelpers
include
MergeRequestHelpers
include
MergeRequestHelpers
include
IssueHelpers
include
IssueHelpers
...
@@ -9,8 +9,8 @@ feature 'Merge requests filter clear button', js: true do
...
@@ -9,8 +9,8 @@ feature 'Merge requests filter clear button', js: true do
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:bug
)
{
create
(
:label
,
project:
project
,
name:
'bug'
)}
let!
(
:bug
)
{
create
(
:label
,
project:
project
,
name:
'bug'
)}
let!
(
:mr1
)
{
create
(
:merge_request
,
title:
"Feature"
,
source_project:
project
,
target_project:
project
,
source_branch:
"
Featur
e"
,
milestone:
milestone
,
author:
user
,
assignee:
user
)
}
let!
(
:mr1
)
{
create
(
:merge_request
,
title:
"Feature"
,
source_project:
project
,
target_project:
project
,
source_branch:
"
improve/awesom
e"
,
milestone:
milestone
,
author:
user
,
assignee:
user
)
}
let!
(
:mr2
)
{
create
(
:merge_request
,
title:
"Bugfix1"
,
source_project:
project
,
target_project:
project
,
source_branch:
"
Bugfix1
"
)
}
let!
(
:mr2
)
{
create
(
:merge_request
,
title:
"Bugfix1"
,
source_project:
project
,
target_project:
project
,
source_branch:
"
fix
"
)
}
let
(
:merge_request_css
)
{
'.merge-request'
}
let
(
:merge_request_css
)
{
'.merge-request'
}
let
(
:clear_search_css
)
{
'.filtered-search-box .clear-search'
}
let
(
:clear_search_css
)
{
'.filtered-search-box .clear-search'
}
...
...
spec/features/task_lists_spec.rb
View file @
ae7c52a0
...
@@ -245,6 +245,10 @@ feature 'Task Lists' do
...
@@ -245,6 +245,10 @@ feature 'Task Lists' do
visit
project_merge_request_path
(
project
,
merge
)
visit
project_merge_request_path
(
project
,
merge
)
end
end
before
do
allow_any_instance_of
(
Repository
).
to
receive
(
:write_ref
)
end
describe
'multiple tasks'
do
describe
'multiple tasks'
do
let!
(
:merge
)
{
create
(
:merge_request
,
:simple
,
description:
markdown
,
author:
user
,
source_project:
project
)
}
let!
(
:merge
)
{
create
(
:merge_request
,
:simple
,
description:
markdown
,
author:
user
,
source_project:
project
)
}
...
...
spec/requests/api/merge_requests_spec.rb
View file @
ae7c52a0
This diff is collapsed.
Click to expand it.
spec/services/create_deployment_service_spec.rb
View file @
ae7c52a0
...
@@ -20,6 +20,10 @@ describe CreateDeploymentService do
...
@@ -20,6 +20,10 @@ describe CreateDeploymentService do
let
(
:service
)
{
described_class
.
new
(
job
)
}
let
(
:service
)
{
described_class
.
new
(
job
)
}
before
do
allow_any_instance_of
(
Deployment
).
to
receive
(
:create_ref
)
end
describe
'#execute'
do
describe
'#execute'
do
subject
{
service
.
execute
}
subject
{
service
.
execute
}
...
...
spec/services/merge_requests/get_urls_service_spec.rb
View file @
ae7c52a0
...
@@ -3,7 +3,7 @@ require "spec_helper"
...
@@ -3,7 +3,7 @@ require "spec_helper"
describe
MergeRequests
::
GetUrlsService
do
describe
MergeRequests
::
GetUrlsService
do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:service
)
{
described_class
.
new
(
project
)
}
let
(
:service
)
{
described_class
.
new
(
project
)
}
let
(
:source_branch
)
{
"m
y_branch
"
}
let
(
:source_branch
)
{
"m
erge-test
"
}
let
(
:new_merge_request_url
)
{
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/
#{
project
.
namespace
.
name
}
/
#{
project
.
path
}
/merge_requests/new?merge_request%5Bsource_branch%5D=
#{
source_branch
}
"
}
let
(
:new_merge_request_url
)
{
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/
#{
project
.
namespace
.
name
}
/
#{
project
.
path
}
/merge_requests/new?merge_request%5Bsource_branch%5D=
#{
source_branch
}
"
}
let
(
:show_merge_request_url
)
{
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/
#{
project
.
namespace
.
name
}
/
#{
project
.
path
}
/merge_requests/
#{
merge_request
.
iid
}
"
}
let
(
:show_merge_request_url
)
{
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/
#{
project
.
namespace
.
name
}
/
#{
project
.
path
}
/merge_requests/
#{
merge_request
.
iid
}
"
}
let
(
:new_branch_changes
)
{
"
#{
Gitlab
::
Git
::
BLANK_SHA
}
570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/
#{
source_branch
}
"
}
let
(
:new_branch_changes
)
{
"
#{
Gitlab
::
Git
::
BLANK_SHA
}
570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/
#{
source_branch
}
"
}
...
@@ -111,9 +111,9 @@ describe MergeRequests::GetUrlsService do
...
@@ -111,9 +111,9 @@ describe MergeRequests::GetUrlsService do
end
end
context
'pushing new branch and existing branch (with merge request created) at once'
do
context
'pushing new branch and existing branch (with merge request created) at once'
do
let!
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
source_branch:
"
existing_branch
"
)
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
source_branch:
"
markdown
"
)
}
let
(
:new_branch_changes
)
{
"
#{
Gitlab
::
Git
::
BLANK_SHA
}
570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/new_branch"
}
let
(
:new_branch_changes
)
{
"
#{
Gitlab
::
Git
::
BLANK_SHA
}
570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/new_branch"
}
let
(
:existing_branch_changes
)
{
"d14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/
existing_branch
"
}
let
(
:existing_branch_changes
)
{
"d14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/
markdown
"
}
let
(
:changes
)
{
"
#{
new_branch_changes
}
\n
#{
existing_branch_changes
}
"
}
let
(
:changes
)
{
"
#{
new_branch_changes
}
\n
#{
existing_branch_changes
}
"
}
let
(
:new_merge_request_url
)
{
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/
#{
project
.
namespace
.
name
}
/
#{
project
.
path
}
/merge_requests/new?merge_request%5Bsource_branch%5D=new_branch"
}
let
(
:new_merge_request_url
)
{
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/
#{
project
.
namespace
.
name
}
/
#{
project
.
path
}
/merge_requests/new?merge_request%5Bsource_branch%5D=new_branch"
}
...
@@ -124,7 +124,7 @@ describe MergeRequests::GetUrlsService do
...
@@ -124,7 +124,7 @@ describe MergeRequests::GetUrlsService do
url:
new_merge_request_url
,
url:
new_merge_request_url
,
new_merge_request:
true
new_merge_request:
true
},
{
},
{
branch_name:
"
existing_branch
"
,
branch_name:
"
markdown
"
,
url:
show_merge_request_url
,
url:
show_merge_request_url
,
new_merge_request:
false
new_merge_request:
false
}])
}])
...
...
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