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
Tatuya Kamada
gitlab-ce
Commits
519275c1
Commit
519275c1
authored
Jul 25, 2016
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes part1 of files to start using active tense
parent
551ffc0a
Changes
75
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
322 additions
and
321 deletions
+322
-321
spec/controllers/admin/users_controller_spec.rb
spec/controllers/admin/users_controller_spec.rb
+1
-1
spec/controllers/application_controller_spec.rb
spec/controllers/application_controller_spec.rb
+3
-3
spec/controllers/groups/avatars_controller_spec.rb
spec/controllers/groups/avatars_controller_spec.rb
+1
-1
spec/controllers/groups/milestones_controller_spec.rb
spec/controllers/groups/milestones_controller_spec.rb
+1
-1
spec/controllers/profiles/avatars_controller_spec.rb
spec/controllers/profiles/avatars_controller_spec.rb
+1
-1
spec/controllers/profiles/keys_controller_spec.rb
spec/controllers/profiles/keys_controller_spec.rb
+9
-9
spec/controllers/projects/avatars_controller_spec.rb
spec/controllers/projects/avatars_controller_spec.rb
+1
-1
spec/controllers/projects/commit_controller_spec.rb
spec/controllers/projects/commit_controller_spec.rb
+13
-13
spec/controllers/projects/commits_controller_spec.rb
spec/controllers/projects/commits_controller_spec.rb
+1
-1
spec/controllers/projects/compare_controller_spec.rb
spec/controllers/projects/compare_controller_spec.rb
+4
-4
spec/controllers/projects/forks_controller_spec.rb
spec/controllers/projects/forks_controller_spec.rb
+5
-5
spec/controllers/projects/issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+8
-8
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+6
-6
spec/controllers/projects/milestones_controller_spec.rb
spec/controllers/projects/milestones_controller_spec.rb
+1
-1
spec/controllers/projects/project_members_controller_spec.rb
spec/controllers/projects/project_members_controller_spec.rb
+1
-1
spec/controllers/projects/protected_branches_controller_spec.rb
...ontrollers/projects/protected_branches_controller_spec.rb
+1
-1
spec/controllers/projects/raw_controller_spec.rb
spec/controllers/projects/raw_controller_spec.rb
+1
-1
spec/controllers/projects/services_controller_spec.rb
spec/controllers/projects/services_controller_spec.rb
+2
-2
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+5
-5
spec/features/admin/admin_abuse_reports_spec.rb
spec/features/admin/admin_abuse_reports_spec.rb
+2
-2
spec/features/admin/admin_hooks_spec.rb
spec/features/admin/admin_hooks_spec.rb
+3
-3
spec/features/admin/admin_projects_spec.rb
spec/features/admin/admin_projects_spec.rb
+3
-3
spec/features/admin/admin_users_spec.rb
spec/features/admin/admin_users_spec.rb
+14
-14
spec/features/atom/dashboard_spec.rb
spec/features/atom/dashboard_spec.rb
+3
-3
spec/features/atom/issues_spec.rb
spec/features/atom/issues_spec.rb
+2
-2
spec/features/atom/users_spec.rb
spec/features/atom/users_spec.rb
+6
-6
spec/features/ci_lint_spec.rb
spec/features/ci_lint_spec.rb
+1
-1
spec/features/commits_spec.rb
spec/features/commits_spec.rb
+1
-1
spec/features/compare_spec.rb
spec/features/compare_spec.rb
+3
-3
spec/features/dashboard/label_filter_spec.rb
spec/features/dashboard/label_filter_spec.rb
+1
-1
spec/features/dashboard_issues_spec.rb
spec/features/dashboard_issues_spec.rb
+3
-3
spec/features/gitlab_flavored_markdown_spec.rb
spec/features/gitlab_flavored_markdown_spec.rb
+12
-12
spec/features/help_pages_spec.rb
spec/features/help_pages_spec.rb
+1
-1
spec/features/issues/award_emoji_spec.rb
spec/features/issues/award_emoji_spec.rb
+5
-5
spec/features/issues/award_spec.rb
spec/features/issues/award_spec.rb
+4
-4
spec/features/issues/bulk_assignment_labels_spec.rb
spec/features/issues/bulk_assignment_labels_spec.rb
+4
-4
spec/features/issues/filter_by_labels_spec.rb
spec/features/issues/filter_by_labels_spec.rb
+23
-23
spec/features/issues/filter_by_milestone_spec.rb
spec/features/issues/filter_by_milestone_spec.rb
+3
-3
spec/features/issues/filter_issues_spec.rb
spec/features/issues/filter_issues_spec.rb
+19
-19
spec/features/issues/issue_sidebar_spec.rb
spec/features/issues/issue_sidebar_spec.rb
+4
-4
spec/features/issues/new_branch_button_spec.rb
spec/features/issues/new_branch_button_spec.rb
+1
-1
spec/features/issues/todo_spec.rb
spec/features/issues/todo_spec.rb
+2
-2
spec/features/issues/update_issues_spec.rb
spec/features/issues/update_issues_spec.rb
+6
-6
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+8
-8
spec/features/login_spec.rb
spec/features/login_spec.rb
+1
-1
spec/features/merge_requests/award_spec.rb
spec/features/merge_requests/award_spec.rb
+4
-4
spec/features/merge_requests/edit_mr_spec.rb
spec/features/merge_requests/edit_mr_spec.rb
+1
-1
spec/features/merge_requests/filter_by_milestone_spec.rb
spec/features/merge_requests/filter_by_milestone_spec.rb
+3
-3
spec/features/merge_requests/merge_when_build_succeeds_spec.rb
...features/merge_requests/merge_when_build_succeeds_spec.rb
+1
-1
spec/features/milestone_spec.rb
spec/features/milestone_spec.rb
+2
-2
spec/features/notes_on_merge_requests_spec.rb
spec/features/notes_on_merge_requests_spec.rb
+6
-6
spec/features/participants_autocomplete_spec.rb
spec/features/participants_autocomplete_spec.rb
+3
-3
spec/features/pipelines_spec.rb
spec/features/pipelines_spec.rb
+5
-5
spec/features/profile_spec.rb
spec/features/profile_spec.rb
+2
-2
spec/features/projects/labels/update_prioritization_spec.rb
spec/features/projects/labels/update_prioritization_spec.rb
+2
-2
spec/features/projects_spec.rb
spec/features/projects_spec.rb
+4
-4
spec/features/search_spec.rb
spec/features/search_spec.rb
+9
-9
spec/features/todos/todos_spec.rb
spec/features/todos/todos_spec.rb
+1
-1
spec/features/variables_spec.rb
spec/features/variables_spec.rb
+4
-4
spec/finders/merge_requests_finder_spec.rb
spec/finders/merge_requests_finder_spec.rb
+2
-2
spec/finders/notes_finder_spec.rb
spec/finders/notes_finder_spec.rb
+2
-2
spec/helpers/application_helper_spec.rb
spec/helpers/application_helper_spec.rb
+10
-10
spec/helpers/blob_helper_spec.rb
spec/helpers/blob_helper_spec.rb
+5
-5
spec/helpers/diff_helper_spec.rb
spec/helpers/diff_helper_spec.rb
+5
-5
spec/helpers/emails_helper_spec.rb
spec/helpers/emails_helper_spec.rb
+6
-6
spec/helpers/events_helper_spec.rb
spec/helpers/events_helper_spec.rb
+7
-7
spec/helpers/gitlab_markdown_helper_spec.rb
spec/helpers/gitlab_markdown_helper_spec.rb
+10
-10
spec/helpers/graph_helper_spec.rb
spec/helpers/graph_helper_spec.rb
+1
-1
spec/helpers/groups_helper_spec.rb
spec/helpers/groups_helper_spec.rb
+2
-2
spec/helpers/issues_helper_spec.rb
spec/helpers/issues_helper_spec.rb
+5
-4
spec/helpers/notes_helper_spec.rb
spec/helpers/notes_helper_spec.rb
+1
-1
spec/helpers/search_helper_spec.rb
spec/helpers/search_helper_spec.rb
+1
-1
spec/helpers/submodule_helper_spec.rb
spec/helpers/submodule_helper_spec.rb
+14
-14
spec/helpers/tree_helper_spec.rb
spec/helpers/tree_helper_spec.rb
+2
-2
spec/lib/ci/charts_spec.rb
spec/lib/ci/charts_spec.rb
+2
-2
No files found.
spec/controllers/admin/users_controller_spec.rb
View file @
519275c1
...
@@ -39,7 +39,7 @@ describe Admin::UsersController do
...
@@ -39,7 +39,7 @@ describe Admin::UsersController do
user
.
ldap_block
user
.
ldap_block
end
end
it
'
will
not unblock user'
do
it
'
does
not unblock user'
do
put
:unblock
,
id:
user
.
username
put
:unblock
,
id:
user
.
username
user
.
reload
user
.
reload
expect
(
user
.
blocked?
).
to
be_truthy
expect
(
user
.
blocked?
).
to
be_truthy
...
...
spec/controllers/application_controller_spec.rb
View file @
519275c1
...
@@ -5,7 +5,7 @@ describe ApplicationController do
...
@@ -5,7 +5,7 @@ describe ApplicationController do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:controller
)
{
ApplicationController
.
new
}
let
(
:controller
)
{
ApplicationController
.
new
}
it
'
should redirect
if the user is over their password expiry'
do
it
'
redirects
if the user is over their password expiry'
do
user
.
password_expires_at
=
Time
.
new
(
2002
)
user
.
password_expires_at
=
Time
.
new
(
2002
)
expect
(
user
.
ldap_user?
).
to
be_falsey
expect
(
user
.
ldap_user?
).
to
be_falsey
allow
(
controller
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
controller
).
to
receive
(
:current_user
).
and_return
(
user
)
...
@@ -14,7 +14,7 @@ describe ApplicationController do
...
@@ -14,7 +14,7 @@ describe ApplicationController do
controller
.
send
(
:check_password_expiration
)
controller
.
send
(
:check_password_expiration
)
end
end
it
'
should
not redirect if the user is under their password expiry'
do
it
'
does
not redirect if the user is under their password expiry'
do
user
.
password_expires_at
=
Time
.
now
+
20010101
user
.
password_expires_at
=
Time
.
now
+
20010101
expect
(
user
.
ldap_user?
).
to
be_falsey
expect
(
user
.
ldap_user?
).
to
be_falsey
allow
(
controller
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
controller
).
to
receive
(
:current_user
).
and_return
(
user
)
...
@@ -22,7 +22,7 @@ describe ApplicationController do
...
@@ -22,7 +22,7 @@ describe ApplicationController do
controller
.
send
(
:check_password_expiration
)
controller
.
send
(
:check_password_expiration
)
end
end
it
'
should
not redirect if the user is over their password expiry but they are an ldap user'
do
it
'
does
not redirect if the user is over their password expiry but they are an ldap user'
do
user
.
password_expires_at
=
Time
.
new
(
2002
)
user
.
password_expires_at
=
Time
.
new
(
2002
)
allow
(
user
).
to
receive
(
:ldap_user?
).
and_return
(
true
)
allow
(
user
).
to
receive
(
:ldap_user?
).
and_return
(
true
)
allow
(
controller
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
controller
).
to
receive
(
:current_user
).
and_return
(
user
)
...
...
spec/controllers/groups/avatars_controller_spec.rb
View file @
519275c1
...
@@ -9,7 +9,7 @@ describe Groups::AvatarsController do
...
@@ -9,7 +9,7 @@ describe Groups::AvatarsController do
sign_in
(
user
)
sign_in
(
user
)
end
end
it
'
destroy should remove avatar from DB
'
do
it
'
removes avatar from DB calling destroy
'
do
delete
:destroy
,
group_id:
group
.
path
delete
:destroy
,
group_id:
group
.
path
@group
=
assigns
(
:group
)
@group
=
assigns
(
:group
)
expect
(
@group
.
avatar
.
present?
).
to
be_falsey
expect
(
@group
.
avatar
.
present?
).
to
be_falsey
...
...
spec/controllers/groups/milestones_controller_spec.rb
View file @
519275c1
...
@@ -15,7 +15,7 @@ describe Groups::MilestonesController do
...
@@ -15,7 +15,7 @@ describe Groups::MilestonesController do
end
end
describe
"#create"
do
describe
"#create"
do
it
"
should create
group milestone with Chinese title"
do
it
"
creates
group milestone with Chinese title"
do
post
:create
,
post
:create
,
group_id:
group
.
id
,
group_id:
group
.
id
,
milestone:
{
project_ids:
[
project
.
id
,
project2
.
id
],
title:
title
}
milestone:
{
project_ids:
[
project
.
id
,
project2
.
id
],
title:
title
}
...
...
spec/controllers/profiles/avatars_controller_spec.rb
View file @
519275c1
...
@@ -8,7 +8,7 @@ describe Profiles::AvatarsController do
...
@@ -8,7 +8,7 @@ describe Profiles::AvatarsController do
controller
.
instance_variable_set
(
:@user
,
user
)
controller
.
instance_variable_set
(
:@user
,
user
)
end
end
it
'
destroy should remove avatar from DB
'
do
it
'
removes avatar from DB by calling destroy
'
do
delete
:destroy
delete
:destroy
@user
=
assigns
(
:user
)
@user
=
assigns
(
:user
)
expect
(
@user
.
avatar
.
present?
).
to
be_falsey
expect
(
@user
.
avatar
.
present?
).
to
be_falsey
...
...
spec/controllers/profiles/keys_controller_spec.rb
View file @
519275c1
...
@@ -6,7 +6,7 @@ describe Profiles::KeysController do
...
@@ -6,7 +6,7 @@ describe Profiles::KeysController do
describe
'#new'
do
describe
'#new'
do
before
{
sign_in
(
user
)
}
before
{
sign_in
(
user
)
}
it
'redirect to #index'
do
it
'redirect
s
to #index'
do
get
:new
get
:new
expect
(
response
).
to
redirect_to
(
profile_keys_path
)
expect
(
response
).
to
redirect_to
(
profile_keys_path
)
...
@@ -15,7 +15,7 @@ describe Profiles::KeysController do
...
@@ -15,7 +15,7 @@ describe Profiles::KeysController do
describe
"#get_keys"
do
describe
"#get_keys"
do
describe
"non existant user"
do
describe
"non existant user"
do
it
"
should generally not
work"
do
it
"
does not generally
work"
do
get
:get_keys
,
username:
'not-existent'
get
:get_keys
,
username:
'not-existent'
expect
(
response
).
not_to
be_success
expect
(
response
).
not_to
be_success
...
@@ -23,19 +23,19 @@ describe Profiles::KeysController do
...
@@ -23,19 +23,19 @@ describe Profiles::KeysController do
end
end
describe
"user with no keys"
do
describe
"user with no keys"
do
it
"
should
generally work"
do
it
"
does
generally work"
do
get
:get_keys
,
username:
user
.
username
get
:get_keys
,
username:
user
.
username
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
end
end
it
"
should render
all keys separated with a new line"
do
it
"
renders
all keys separated with a new line"
do
get
:get_keys
,
username:
user
.
username
get
:get_keys
,
username:
user
.
username
expect
(
response
.
body
).
to
eq
(
""
)
expect
(
response
.
body
).
to
eq
(
""
)
end
end
it
"
should respond
with text/plain content type"
do
it
"
responds
with text/plain content type"
do
get
:get_keys
,
username:
user
.
username
get
:get_keys
,
username:
user
.
username
expect
(
response
.
content_type
).
to
eq
(
"text/plain"
)
expect
(
response
.
content_type
).
to
eq
(
"text/plain"
)
end
end
...
@@ -47,13 +47,13 @@ describe Profiles::KeysController do
...
@@ -47,13 +47,13 @@ describe Profiles::KeysController do
user
.
keys
<<
create
(
:another_key
)
user
.
keys
<<
create
(
:another_key
)
end
end
it
"
should
generally work"
do
it
"
does
generally work"
do
get
:get_keys
,
username:
user
.
username
get
:get_keys
,
username:
user
.
username
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
end
end
it
"
should render
all keys separated with a new line"
do
it
"
renders
all keys separated with a new line"
do
get
:get_keys
,
username:
user
.
username
get
:get_keys
,
username:
user
.
username
expect
(
response
.
body
).
not_to
eq
(
""
)
expect
(
response
.
body
).
not_to
eq
(
""
)
...
@@ -65,13 +65,13 @@ describe Profiles::KeysController do
...
@@ -65,13 +65,13 @@ describe Profiles::KeysController do
expect
(
response
.
body
).
to
match
(
/AQDmTillFzNTrrGgwaCKaSj/
)
expect
(
response
.
body
).
to
match
(
/AQDmTillFzNTrrGgwaCKaSj/
)
end
end
it
"
should
not render the comment of the key"
do
it
"
does
not render the comment of the key"
do
get
:get_keys
,
username:
user
.
username
get
:get_keys
,
username:
user
.
username
expect
(
response
.
body
).
not_to
match
(
/dummy@gitlab.com/
)
expect
(
response
.
body
).
not_to
match
(
/dummy@gitlab.com/
)
end
end
it
"
should respond
with text/plain content type"
do
it
"
responds
with text/plain content type"
do
get
:get_keys
,
username:
user
.
username
get
:get_keys
,
username:
user
.
username
expect
(
response
.
content_type
).
to
eq
(
"text/plain"
)
expect
(
response
.
content_type
).
to
eq
(
"text/plain"
)
end
end
...
...
spec/controllers/projects/avatars_controller_spec.rb
View file @
519275c1
...
@@ -10,7 +10,7 @@ describe Projects::AvatarsController do
...
@@ -10,7 +10,7 @@ describe Projects::AvatarsController do
controller
.
instance_variable_set
(
:@project
,
project
)
controller
.
instance_variable_set
(
:@project
,
project
)
end
end
it
'
destroy should remove avatar from DB
'
do
it
'
removes avatar from DB by calling destroy
'
do
delete
:destroy
,
namespace_id:
project
.
namespace
.
id
,
project_id:
project
.
id
delete
:destroy
,
namespace_id:
project
.
namespace
.
id
,
project_id:
project
.
id
expect
(
project
.
avatar
.
present?
).
to
be_falsey
expect
(
project
.
avatar
.
present?
).
to
be_falsey
expect
(
project
).
to
be_valid
expect
(
project
).
to
be_valid
...
...
spec/controllers/projects/commit_controller_spec.rb
View file @
519275c1
...
@@ -47,25 +47,25 @@ describe Projects::CommitController do
...
@@ -47,25 +47,25 @@ describe Projects::CommitController do
end
end
shared_examples
"export as"
do
|
format
|
shared_examples
"export as"
do
|
format
|
it
"
should
generally work"
do
it
"
does
generally work"
do
go
(
id:
commit
.
id
,
format:
format
)
go
(
id:
commit
.
id
,
format:
format
)
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
end
end
it
"
should generate
it"
do
it
"
generates
it"
do
expect_any_instance_of
(
Commit
).
to
receive
(
:"to_
#{
format
}
"
)
expect_any_instance_of
(
Commit
).
to
receive
(
:"to_
#{
format
}
"
)
go
(
id:
commit
.
id
,
format:
format
)
go
(
id:
commit
.
id
,
format:
format
)
end
end
it
"
should render
it"
do
it
"
renders
it"
do
go
(
id:
commit
.
id
,
format:
format
)
go
(
id:
commit
.
id
,
format:
format
)
expect
(
response
.
body
).
to
eq
(
commit
.
send
(
:"to_
#{
format
}
"
))
expect
(
response
.
body
).
to
eq
(
commit
.
send
(
:"to_
#{
format
}
"
))
end
end
it
"
should
not escape Html"
do
it
"
does
not escape Html"
do
allow_any_instance_of
(
Commit
).
to
receive
(
:"to_
#{
format
}
"
).
allow_any_instance_of
(
Commit
).
to
receive
(
:"to_
#{
format
}
"
).
and_return
(
'HTML entities &<>" '
)
and_return
(
'HTML entities &<>" '
)
...
@@ -88,7 +88,7 @@ describe Projects::CommitController do
...
@@ -88,7 +88,7 @@ describe Projects::CommitController do
expect
(
response
.
body
).
to
start_with
(
"diff --git"
)
expect
(
response
.
body
).
to
start_with
(
"diff --git"
)
end
end
it
"
should really
only be a git diff without whitespace changes"
do
it
"
is
only be a git diff without whitespace changes"
do
go
(
id:
'66eceea0db202bb39c4e445e8ca28689645366c5'
,
format:
format
,
w:
1
)
go
(
id:
'66eceea0db202bb39c4e445e8ca28689645366c5'
,
format:
format
,
w:
1
)
expect
(
response
.
body
).
to
start_with
(
"diff --git"
)
expect
(
response
.
body
).
to
start_with
(
"diff --git"
)
...
@@ -103,13 +103,13 @@ describe Projects::CommitController do
...
@@ -103,13 +103,13 @@ describe Projects::CommitController do
include_examples
"export as"
,
:patch
include_examples
"export as"
,
:patch
let
(
:format
)
{
:patch
}
let
(
:format
)
{
:patch
}
it
"
should really be
a git email patch"
do
it
"
is
a git email patch"
do
go
(
id:
commit
.
id
,
format:
format
)
go
(
id:
commit
.
id
,
format:
format
)
expect
(
response
.
body
).
to
start_with
(
"From
#{
commit
.
id
}
"
)
expect
(
response
.
body
).
to
start_with
(
"From
#{
commit
.
id
}
"
)
end
end
it
"
should contain
a git diff"
do
it
"
contains
a git diff"
do
go
(
id:
commit
.
id
,
format:
format
)
go
(
id:
commit
.
id
,
format:
format
)
expect
(
response
.
body
).
to
match
(
/^diff --git/
)
expect
(
response
.
body
).
to
match
(
/^diff --git/
)
...
@@ -147,7 +147,7 @@ describe Projects::CommitController do
...
@@ -147,7 +147,7 @@ describe Projects::CommitController do
describe
'POST revert'
do
describe
'POST revert'
do
context
'when target branch is not provided'
do
context
'when target branch is not provided'
do
it
'
should render
the 404 page'
do
it
'
renders
the 404 page'
do
post
(
:revert
,
post
(
:revert
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
...
@@ -159,7 +159,7 @@ describe Projects::CommitController do
...
@@ -159,7 +159,7 @@ describe Projects::CommitController do
end
end
context
'when the revert was successful'
do
context
'when the revert was successful'
do
it
'
should redirect
to the commits page'
do
it
'
redirects
to the commits page'
do
post
(
:revert
,
post
(
:revert
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
...
@@ -180,7 +180,7 @@ describe Projects::CommitController do
...
@@ -180,7 +180,7 @@ describe Projects::CommitController do
id:
commit
.
id
)
id:
commit
.
id
)
end
end
it
'
should redirect
to the commit page'
do
it
'
redirects
to the commit page'
do
# Reverting a commit that has been already reverted.
# Reverting a commit that has been already reverted.
post
(
:revert
,
post
(
:revert
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
...
@@ -196,7 +196,7 @@ describe Projects::CommitController do
...
@@ -196,7 +196,7 @@ describe Projects::CommitController do
describe
'POST cherry_pick'
do
describe
'POST cherry_pick'
do
context
'when target branch is not provided'
do
context
'when target branch is not provided'
do
it
'
should render
the 404 page'
do
it
'
renders
the 404 page'
do
post
(
:cherry_pick
,
post
(
:cherry_pick
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
...
@@ -208,7 +208,7 @@ describe Projects::CommitController do
...
@@ -208,7 +208,7 @@ describe Projects::CommitController do
end
end
context
'when the cherry-pick was successful'
do
context
'when the cherry-pick was successful'
do
it
'
should redirect
to the commits page'
do
it
'
redirects
to the commits page'
do
post
(
:cherry_pick
,
post
(
:cherry_pick
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
...
@@ -229,7 +229,7 @@ describe Projects::CommitController do
...
@@ -229,7 +229,7 @@ describe Projects::CommitController do
id:
master_pickable_commit
.
id
)
id:
master_pickable_commit
.
id
)
end
end
it
'
should redirect
to the commit page'
do
it
'
redirects
to the commit page'
do
# Cherry-picking a commit that has been already cherry-picked.
# Cherry-picking a commit that has been already cherry-picked.
post
(
:cherry_pick
,
post
(
:cherry_pick
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
...
...
spec/controllers/projects/commits_controller_spec.rb
View file @
519275c1
...
@@ -11,7 +11,7 @@ describe Projects::CommitsController do
...
@@ -11,7 +11,7 @@ describe Projects::CommitsController do
describe
"GET show"
do
describe
"GET show"
do
context
"as atom feed"
do
context
"as atom feed"
do
it
"
should render
as atom"
do
it
"
renders
as atom"
do
get
(
:show
,
get
(
:show
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
...
...
spec/controllers/projects/compare_controller_spec.rb
View file @
519275c1
...
@@ -11,7 +11,7 @@ describe Projects::CompareController do
...
@@ -11,7 +11,7 @@ describe Projects::CompareController do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
end
end
it
'compare sho
uld show
some diffs'
do
it
'compare sho
ws
some diffs'
do
get
(
:show
,
get
(
:show
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
...
@@ -23,7 +23,7 @@ describe Projects::CompareController do
...
@@ -23,7 +23,7 @@ describe Projects::CompareController do
expect
(
assigns
(
:commits
).
length
).
to
be
>=
1
expect
(
assigns
(
:commits
).
length
).
to
be
>=
1
end
end
it
'compare sho
uld show
some diffs with ignore whitespace change option'
do
it
'compare sho
ws
some diffs with ignore whitespace change option'
do
get
(
:show
,
get
(
:show
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
...
@@ -41,7 +41,7 @@ describe Projects::CompareController do
...
@@ -41,7 +41,7 @@ describe Projects::CompareController do
end
end
describe
'non-existent refs'
do
describe
'non-existent refs'
do
it
'invalid source ref'
do
it
'
uses
invalid source ref'
do
get
(
:show
,
get
(
:show
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
...
@@ -53,7 +53,7 @@ describe Projects::CompareController do
...
@@ -53,7 +53,7 @@ describe Projects::CompareController do
expect
(
assigns
(
:commits
)).
to
eq
([])
expect
(
assigns
(
:commits
)).
to
eq
([])
end
end
it
'invalid target ref'
do
it
'
uses
invalid target ref'
do
get
(
:show
,
get
(
:show
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
...
...
spec/controllers/projects/forks_controller_spec.rb
View file @
519275c1
...
@@ -16,7 +16,7 @@ describe Projects::ForksController do
...
@@ -16,7 +16,7 @@ describe Projects::ForksController do
context
'when fork is public'
do
context
'when fork is public'
do
before
{
forked_project
.
update_attribute
(
:visibility_level
,
Project
::
PUBLIC
)
}
before
{
forked_project
.
update_attribute
(
:visibility_level
,
Project
::
PUBLIC
)
}
it
'
should be
visible for non logged in users'
do
it
'
is
visible for non logged in users'
do
get_forks
get_forks
expect
(
assigns
[
:forks
]).
to
be_present
expect
(
assigns
[
:forks
]).
to
be_present
...
@@ -28,7 +28,7 @@ describe Projects::ForksController do
...
@@ -28,7 +28,7 @@ describe Projects::ForksController do
forked_project
.
update_attributes
(
visibility_level:
Project
::
PRIVATE
,
group:
group
)
forked_project
.
update_attributes
(
visibility_level:
Project
::
PRIVATE
,
group:
group
)
end
end
it
'
should
not be visible for non logged in users'
do
it
'
is
not be visible for non logged in users'
do
get_forks
get_forks
expect
(
assigns
[
:forks
]).
to
be_blank
expect
(
assigns
[
:forks
]).
to
be_blank
...
@@ -38,7 +38,7 @@ describe Projects::ForksController do
...
@@ -38,7 +38,7 @@ describe Projects::ForksController do
before
{
sign_in
(
project
.
creator
)
}
before
{
sign_in
(
project
.
creator
)
}
context
'when user is not a Project member neither a group member'
do
context
'when user is not a Project member neither a group member'
do
it
'
should
not see the Project listed'
do
it
'
does
not see the Project listed'
do
get_forks
get_forks
expect
(
assigns
[
:forks
]).
to
be_blank
expect
(
assigns
[
:forks
]).
to
be_blank
...
@@ -48,7 +48,7 @@ describe Projects::ForksController do
...
@@ -48,7 +48,7 @@ describe Projects::ForksController do
context
'when user is a member of the Project'
do
context
'when user is a member of the Project'
do
before
{
forked_project
.
team
<<
[
project
.
creator
,
:developer
]
}
before
{
forked_project
.
team
<<
[
project
.
creator
,
:developer
]
}
it
's
hould see
the project listed'
do
it
's
ees
the project listed'
do
get_forks
get_forks
expect
(
assigns
[
:forks
]).
to
be_present
expect
(
assigns
[
:forks
]).
to
be_present
...
@@ -58,7 +58,7 @@ describe Projects::ForksController do
...
@@ -58,7 +58,7 @@ describe Projects::ForksController do
context
'when user is a member of the Group'
do
context
'when user is a member of the Group'
do
before
{
forked_project
.
group
.
add_developer
(
project
.
creator
)
}
before
{
forked_project
.
group
.
add_developer
(
project
.
creator
)
}
it
's
hould see
the project listed'
do
it
's
ees
the project listed'
do
get_forks
get_forks
expect
(
assigns
[
:forks
]).
to
be_present
expect
(
assigns
[
:forks
]).
to
be_present
...
...
spec/controllers/projects/issues_controller_spec.rb
View file @
519275c1
...
@@ -30,7 +30,7 @@ describe Projects::IssuesController do
...
@@ -30,7 +30,7 @@ describe Projects::IssuesController do
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
end
end
it
"return 301 if request path doesn't match project path"
do
it
"return
s
301 if request path doesn't match project path"
do
get
:index
,
namespace_id:
project
.
namespace
.
path
,
project_id:
project
.
path
.
upcase
get
:index
,
namespace_id:
project
.
namespace
.
path
,
project_id:
project
.
path
.
upcase
expect
(
response
).
to
redirect_to
(
namespace_project_issues_path
(
project
.
namespace
,
project
))
expect
(
response
).
to
redirect_to
(
namespace_project_issues_path
(
project
.
namespace
,
project
))
...
@@ -119,21 +119,21 @@ describe Projects::IssuesController do
...
@@ -119,21 +119,21 @@ describe Projects::IssuesController do
let!
(
:request_forgery_timing_attack
)
{
create
(
:issue
,
:confidential
,
project:
project
,
assignee:
assignee
)
}
let!
(
:request_forgery_timing_attack
)
{
create
(
:issue
,
:confidential
,
project:
project
,
assignee:
assignee
)
}
describe
'GET #index'
do
describe
'GET #index'
do
it
'
should
not list confidential issues for guests'
do
it
'
does
not list confidential issues for guests'
do
sign_out
(
:user
)
sign_out
(
:user
)
get_issues
get_issues
expect
(
assigns
(
:issues
)).
to
eq
[
issue
]
expect
(
assigns
(
:issues
)).
to
eq
[
issue
]
end
end
it
'
should
not list confidential issues for non project members'
do
it
'
does
not list confidential issues for non project members'
do
sign_in
(
non_member
)
sign_in
(
non_member
)
get_issues
get_issues
expect
(
assigns
(
:issues
)).
to
eq
[
issue
]
expect
(
assigns
(
:issues
)).
to
eq
[
issue
]
end
end
it
'
should
not list confidential issues for project members with guest role'
do
it
'
does
not list confidential issues for project members with guest role'
do
sign_in
(
member
)
sign_in
(
member
)
project
.
team
<<
[
member
,
:guest
]
project
.
team
<<
[
member
,
:guest
]
...
@@ -142,7 +142,7 @@ describe Projects::IssuesController do
...
@@ -142,7 +142,7 @@ describe Projects::IssuesController do
expect
(
assigns
(
:issues
)).
to
eq
[
issue
]
expect
(
assigns
(
:issues
)).
to
eq
[
issue
]
end
end
it
'
should list
confidential issues for author'
do
it
'
lists
confidential issues for author'
do
sign_in
(
author
)
sign_in
(
author
)
get_issues
get_issues
...
@@ -150,7 +150,7 @@ describe Projects::IssuesController do
...
@@ -150,7 +150,7 @@ describe Projects::IssuesController do
expect
(
assigns
(
:issues
)).
not_to
include
request_forgery_timing_attack
expect
(
assigns
(
:issues
)).
not_to
include
request_forgery_timing_attack
end
end
it
'
should list
confidential issues for assignee'
do
it
'
lists
confidential issues for assignee'
do
sign_in
(
assignee
)
sign_in
(
assignee
)
get_issues
get_issues
...
@@ -158,7 +158,7 @@ describe Projects::IssuesController do
...
@@ -158,7 +158,7 @@ describe Projects::IssuesController do
expect
(
assigns
(
:issues
)).
to
include
request_forgery_timing_attack
expect
(
assigns
(
:issues
)).
to
include
request_forgery_timing_attack
end
end
it
'
should list
confidential issues for project members'
do
it
'
lists
confidential issues for project members'
do
sign_in
(
member
)
sign_in
(
member
)
project
.
team
<<
[
member
,
:developer
]
project
.
team
<<
[
member
,
:developer
]
...
@@ -168,7 +168,7 @@ describe Projects::IssuesController do
...
@@ -168,7 +168,7 @@ describe Projects::IssuesController do
expect
(
assigns
(
:issues
)).
to
include
request_forgery_timing_attack
expect
(
assigns
(
:issues
)).
to
include
request_forgery_timing_attack
end
end
it
'
should list
confidential issues for admin'
do
it
'
lists
confidential issues for admin'
do
sign_in
(
admin
)
sign_in
(
admin
)
get_issues
get_issues
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
519275c1
...
@@ -36,7 +36,7 @@ describe Projects::MergeRequestsController do
...
@@ -36,7 +36,7 @@ describe Projects::MergeRequestsController do
describe
"GET show"
do
describe
"GET show"
do
shared_examples
"export merge as"
do
|
format
|
shared_examples
"export merge as"
do
|
format
|
it
"
should
generally work"
do
it
"
does
generally work"
do
get
(
:show
,
get
(
:show
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
...
@@ -46,7 +46,7 @@ describe Projects::MergeRequestsController do
...
@@ -46,7 +46,7 @@ describe Projects::MergeRequestsController do
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
end
end
it
"
should generate
it"
do
it
"
generates
it"
do
expect_any_instance_of
(
MergeRequest
).
to
receive
(
:"to_
#{
format
}
"
)
expect_any_instance_of
(
MergeRequest
).
to
receive
(
:"to_
#{
format
}
"
)
get
(
:show
,
get
(
:show
,
...
@@ -56,7 +56,7 @@ describe Projects::MergeRequestsController do
...
@@ -56,7 +56,7 @@ describe Projects::MergeRequestsController do
format:
format
)
format:
format
)
end
end
it
"
should render
it"
do
it
"
renders
it"
do
get
(
:show
,
get
(
:show
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
...
@@ -66,7 +66,7 @@ describe Projects::MergeRequestsController do
...
@@ -66,7 +66,7 @@ describe Projects::MergeRequestsController do
expect
(
response
.
body
).
to
eq
(
merge_request
.
send
(
:"to_
#{
format
}
"
).
to_s
)
expect
(
response
.
body
).
to
eq
(
merge_request
.
send
(
:"to_
#{
format
}
"
).
to_s
)
end
end
it
"
should
not escape Html"
do
it
"
does
not escape Html"
do
allow_any_instance_of
(
MergeRequest
).
to
receive
(
:"to_
#{
format
}
"
).
allow_any_instance_of
(
MergeRequest
).
to
receive
(
:"to_
#{
format
}
"
).
and_return
(
'HTML entities &<>" '
)
and_return
(
'HTML entities &<>" '
)
...
@@ -118,7 +118,7 @@ describe Projects::MergeRequestsController do
...
@@ -118,7 +118,7 @@ describe Projects::MergeRequestsController do
context
'when filtering by opened state'
do
context
'when filtering by opened state'
do
context
'with opened merge requests'
do
context
'with opened merge requests'
do
it
'
should list
those merge requests'
do
it
'
lists
those merge requests'
do
get_merge_requests
get_merge_requests
expect
(
assigns
(
:merge_requests
)).
to
include
(
merge_request
)
expect
(
assigns
(
:merge_requests
)).
to
include
(
merge_request
)
...
@@ -131,7 +131,7 @@ describe Projects::MergeRequestsController do
...
@@ -131,7 +131,7 @@ describe Projects::MergeRequestsController do
merge_request
.
reopen!
merge_request
.
reopen!
end
end
it
'
should list
those merge requests'
do
it
'
lists
those merge requests'
do
get_merge_requests
get_merge_requests
expect
(
assigns
(
:merge_requests
)).
to
include
(
merge_request
)
expect
(
assigns
(
:merge_requests
)).
to
include
(
merge_request
)
...
...
spec/controllers/projects/milestones_controller_spec.rb
View file @
519275c1
...
@@ -14,7 +14,7 @@ describe Projects::MilestonesController do
...
@@ -14,7 +14,7 @@ describe Projects::MilestonesController do
end
end
describe
"#destroy"
do
describe
"#destroy"
do
it
"
should remove
milestone"
do
it
"
removes
milestone"
do
expect
(
issue
.
milestone_id
).
to
eq
(
milestone
.
id
)
expect
(
issue
.
milestone_id
).
to
eq
(
milestone
.
id
)
delete
:destroy
,
namespace_id:
project
.
namespace
.
id
,
project_id:
project
.
id
,
id:
milestone
.
iid
,
format: :js
delete
:destroy
,
namespace_id:
project
.
namespace
.
id
,
project_id:
project
.
id
,
id:
milestone
.
iid
,
format: :js
...
...
spec/controllers/projects/project_members_controller_spec.rb
View file @
519275c1
...
@@ -167,7 +167,7 @@ describe Projects::ProjectMembersController do
...
@@ -167,7 +167,7 @@ describe Projects::ProjectMembersController do
sign_in
(
user
)
sign_in
(
user
)
end
end
it
'
can
not remove himself from the project'
do
it
'
does
not remove himself from the project'
do
delete
:leave
,
namespace_id:
project
.
namespace
,
delete
:leave
,
namespace_id:
project
.
namespace
,
project_id:
project
project_id:
project
...
...
spec/controllers/projects/protected_branches_controller_spec.rb
View file @
519275c1
...
@@ -3,7 +3,7 @@ require('spec_helper')
...
@@ -3,7 +3,7 @@ require('spec_helper')
describe
Projects
::
ProtectedBranchesController
do
describe
Projects
::
ProtectedBranchesController
do
describe
"GET #index"
do
describe
"GET #index"
do
let
(
:project
)
{
create
(
:project_empty_repo
,
:public
)
}
let
(
:project
)
{
create
(
:project_empty_repo
,
:public
)
}
it
"redirect empty repo to projects page"
do
it
"redirect
s
empty repo to projects page"
do
get
(
:index
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
)
get
(
:index
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
)
end
end
end
end
...
...
spec/controllers/projects/raw_controller_spec.rb
View file @
519275c1
...
@@ -24,7 +24,7 @@ describe Projects::RawController do
...
@@ -24,7 +24,7 @@ describe Projects::RawController do
context
'image header'
do
context
'image header'
do
let
(
:id
)
{
'master/files/images/6049019_460s.jpg'
}
let
(
:id
)
{
'master/files/images/6049019_460s.jpg'
}
it
'set image content type header'
do
it
'set
s
image content type header'
do
get
(
:show
,
get
(
:show
,
namespace_id:
public_project
.
namespace
.
to_param
,
namespace_id:
public_project
.
namespace
.
to_param
,
project_id:
public_project
.
to_param
,
project_id:
public_project
.
to_param
,
...
...
spec/controllers/projects/services_controller_spec.rb
View file @
519275c1
...
@@ -19,7 +19,7 @@ describe Projects::ServicesController do
...
@@ -19,7 +19,7 @@ describe Projects::ServicesController do
describe
"#test"
do
describe
"#test"
do
context
'success'
do
context
'success'
do
it
"
should redirect
and show success message"
do
it
"
redirects
and show success message"
do
expect
(
service
).
to
receive
(
:test
).
and_return
({
success:
true
,
result:
'done'
})
expect
(
service
).
to
receive
(
:test
).
and_return
({
success:
true
,
result:
'done'
})
get
:test
,
namespace_id:
project
.
namespace
.
id
,
project_id:
project
.
id
,
id:
service
.
id
,
format: :html
get
:test
,
namespace_id:
project
.
namespace
.
id
,
project_id:
project
.
id
,
id:
service
.
id
,
format: :html
expect
(
response
.
status
).
to
redirect_to
(
'/'
)
expect
(
response
.
status
).
to
redirect_to
(
'/'
)
...
@@ -28,7 +28,7 @@ describe Projects::ServicesController do
...
@@ -28,7 +28,7 @@ describe Projects::ServicesController do
end
end
context
'failure'
do
context
'failure'
do
it
"
should redirect
and show failure message"
do
it
"
redirects
and show failure message"
do
expect
(
service
).
to
receive
(
:test
).
and_return
({
success:
false
,
result:
'Bad test'
})
expect
(
service
).
to
receive
(
:test
).
and_return
({
success:
false
,
result:
'Bad test'
})
get
:test
,
namespace_id:
project
.
namespace
.
id
,
project_id:
project
.
id
,
id:
service
.
id
,
format: :html
get
:test
,
namespace_id:
project
.
namespace
.
id
,
project_id:
project
.
id
,
id:
service
.
id
,
format: :html
expect
(
response
.
status
).
to
redirect_to
(
'/'
)
expect
(
response
.
status
).
to
redirect_to
(
'/'
)
...
...
spec/controllers/projects_controller_spec.rb
View file @
519275c1
...
@@ -128,7 +128,7 @@ describe ProjectsController do
...
@@ -128,7 +128,7 @@ describe ProjectsController do
context
"when the url contains .atom"
do
context
"when the url contains .atom"
do
let
(
:public_project_with_dot_atom
)
{
build
(
:project
,
:public
,
name:
'my.atom'
,
path:
'my.atom'
)
}
let
(
:public_project_with_dot_atom
)
{
build
(
:project
,
:public
,
name:
'my.atom'
,
path:
'my.atom'
)
}
it
'expect an error creating the project'
do
it
'expect
s
an error creating the project'
do
expect
(
public_project_with_dot_atom
).
not_to
be_valid
expect
(
public_project_with_dot_atom
).
not_to
be_valid
end
end
end
end
...
@@ -222,7 +222,7 @@ describe ProjectsController do
...
@@ -222,7 +222,7 @@ describe ProjectsController do
create
(
:forked_project_link
,
forked_to_project:
project_fork
)
create
(
:forked_project_link
,
forked_to_project:
project_fork
)
end
end
it
'
should remove
fork from project'
do
it
'
removes
fork from project'
do
delete
(
:remove_fork
,
delete
(
:remove_fork
,
namespace_id:
project_fork
.
namespace
.
to_param
,
namespace_id:
project_fork
.
namespace
.
to_param
,
id:
project_fork
.
to_param
,
format: :js
)
id:
project_fork
.
to_param
,
format: :js
)
...
@@ -236,7 +236,7 @@ describe ProjectsController do
...
@@ -236,7 +236,7 @@ describe ProjectsController do
context
'when project not forked'
do
context
'when project not forked'
do
let
(
:unforked_project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:unforked_project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
it
'
should do
nothing if project was not forked'
do
it
'
does
nothing if project was not forked'
do
delete
(
:remove_fork
,
delete
(
:remove_fork
,
namespace_id:
unforked_project
.
namespace
.
to_param
,
namespace_id:
unforked_project
.
namespace
.
to_param
,
id:
unforked_project
.
to_param
,
format: :js
)
id:
unforked_project
.
to_param
,
format: :js
)
...
@@ -256,7 +256,7 @@ describe ProjectsController do
...
@@ -256,7 +256,7 @@ describe ProjectsController do
end
end
describe
"GET refs"
do
describe
"GET refs"
do
it
"
should get
a list of branches and tags"
do
it
"
gets
a list of branches and tags"
do
get
:refs
,
namespace_id:
public_project
.
namespace
.
path
,
id:
public_project
.
path
get
:refs
,
namespace_id:
public_project
.
namespace
.
path
,
id:
public_project
.
path
parsed_body
=
JSON
.
parse
(
response
.
body
)
parsed_body
=
JSON
.
parse
(
response
.
body
)
...
@@ -265,7 +265,7 @@ describe ProjectsController do
...
@@ -265,7 +265,7 @@ describe ProjectsController do
expect
(
parsed_body
[
"Commits"
]).
to
be_nil
expect
(
parsed_body
[
"Commits"
]).
to
be_nil
end
end
it
"
should get
a list of branches, tags and commits"
do
it
"
gets
a list of branches, tags and commits"
do
get
:refs
,
namespace_id:
public_project
.
namespace
.
path
,
id:
public_project
.
path
,
ref:
"123456"
get
:refs
,
namespace_id:
public_project
.
namespace
.
path
,
id:
public_project
.
path
,
ref:
"123456"
parsed_body
=
JSON
.
parse
(
response
.
body
)
parsed_body
=
JSON
.
parse
(
response
.
body
)
...
...
spec/features/admin/admin_abuse_reports_spec.rb
View file @
519275c1
...
@@ -11,7 +11,7 @@ describe "Admin::AbuseReports", feature: true, js: true do
...
@@ -11,7 +11,7 @@ describe "Admin::AbuseReports", feature: true, js: true do
end
end
describe
'in the abuse report view'
do
describe
'in the abuse report view'
do
it
"
should present
a link to the user's profile"
do
it
"
presents
a link to the user's profile"
do
visit
admin_abuse_reports_path
visit
admin_abuse_reports_path
expect
(
page
).
to
have_link
user
.
name
,
href:
user_path
(
user
)
expect
(
page
).
to
have_link
user
.
name
,
href:
user_path
(
user
)
...
@@ -19,7 +19,7 @@ describe "Admin::AbuseReports", feature: true, js: true do
...
@@ -19,7 +19,7 @@ describe "Admin::AbuseReports", feature: true, js: true do
end
end
describe
'in the profile page of the user'
do
describe
'in the profile page of the user'
do
it
'sho
uld show
a link to the admin view of the user'
do
it
'sho
ws
a link to the admin view of the user'
do
visit
user_path
(
user
)
visit
user_path
(
user
)
expect
(
page
).
to
have_link
''
,
href:
admin_user_path
(
user
)
expect
(
page
).
to
have_link
''
,
href:
admin_user_path
(
user
)
...
...
spec/features/admin/admin_hooks_spec.rb
View file @
519275c1
...
@@ -9,7 +9,7 @@ describe "Admin::Hooks", feature: true do
...
@@ -9,7 +9,7 @@ describe "Admin::Hooks", feature: true do
end
end
describe
"GET /admin/hooks"
do
describe
"GET /admin/hooks"
do
it
"
should be
ok"
do
it
"
is
ok"
do
visit
admin_root_path
visit
admin_root_path
page
.
within
".layout-nav"
do
page
.
within
".layout-nav"
do
...
@@ -19,7 +19,7 @@ describe "Admin::Hooks", feature: true do
...
@@ -19,7 +19,7 @@ describe "Admin::Hooks", feature: true do
expect
(
current_path
).
to
eq
(
admin_hooks_path
)
expect
(
current_path
).
to
eq
(
admin_hooks_path
)
end
end
it
"
should have
hooks list"
do
it
"
has
hooks list"
do
visit
admin_hooks_path
visit
admin_hooks_path
expect
(
page
).
to
have_content
(
@system_hook
.
url
)
expect
(
page
).
to
have_content
(
@system_hook
.
url
)
end
end
...
@@ -33,7 +33,7 @@ describe "Admin::Hooks", feature: true do
...
@@ -33,7 +33,7 @@ describe "Admin::Hooks", feature: true do
expect
{
click_button
"Add System Hook"
}.
to
change
(
SystemHook
,
:count
).
by
(
1
)
expect
{
click_button
"Add System Hook"
}.
to
change
(
SystemHook
,
:count
).
by
(
1
)
end
end
it
"
should open
new hook popup"
do
it
"
opens
new hook popup"
do
expect
(
current_path
).
to
eq
(
admin_hooks_path
)
expect
(
current_path
).
to
eq
(
admin_hooks_path
)
expect
(
page
).
to
have_content
(
@url
)
expect
(
page
).
to
have_content
(
@url
)
end
end
...
...
spec/features/admin/admin_projects_spec.rb
View file @
519275c1
...
@@ -11,11 +11,11 @@ describe "Admin::Projects", feature: true do
...
@@ -11,11 +11,11 @@ describe "Admin::Projects", feature: true do
visit
admin_namespaces_projects_path
visit
admin_namespaces_projects_path
end
end
it
"
should be
ok"
do
it
"
is
ok"
do
expect
(
current_path
).
to
eq
(
admin_namespaces_projects_path
)
expect
(
current_path
).
to
eq
(
admin_namespaces_projects_path
)
end
end
it
"
should have
projects list"
do
it
"
has
projects list"
do
expect
(
page
).
to
have_content
(
@project
.
name
)
expect
(
page
).
to
have_content
(
@project
.
name
)
end
end
end
end
...
@@ -26,7 +26,7 @@ describe "Admin::Projects", feature: true do
...
@@ -26,7 +26,7 @@ describe "Admin::Projects", feature: true do
click_link
"
#{
@project
.
name
}
"
click_link
"
#{
@project
.
name
}
"
end
end
it
"
should have
project info"
do
it
"
has
project info"
do
expect
(
page
).
to
have_content
(
@project
.
path
)
expect
(
page
).
to
have_content
(
@project
.
path
)
expect
(
page
).
to
have_content
(
@project
.
name
)
expect
(
page
).
to
have_content
(
@project
.
name
)
end
end
...
...
spec/features/admin/admin_users_spec.rb
View file @
519275c1
...
@@ -8,11 +8,11 @@ describe "Admin::Users", feature: true do
...
@@ -8,11 +8,11 @@ describe "Admin::Users", feature: true do
visit
admin_users_path
visit
admin_users_path
end
end
it
"
should be
ok"
do
it
"
is
ok"
do
expect
(
current_path
).
to
eq
(
admin_users_path
)
expect
(
current_path
).
to
eq
(
admin_users_path
)
end
end
it
"
should have
users list"
do
it
"
has
users list"
do
expect
(
page
).
to
have_content
(
@user
.
email
)
expect
(
page
).
to
have_content
(
@user
.
email
)
expect
(
page
).
to
have_content
(
@user
.
name
)
expect
(
page
).
to
have_content
(
@user
.
name
)
end
end
...
@@ -66,11 +66,11 @@ describe "Admin::Users", feature: true do
...
@@ -66,11 +66,11 @@ describe "Admin::Users", feature: true do
fill_in
"user_email"
,
with:
"bigbang@mail.com"
fill_in
"user_email"
,
with:
"bigbang@mail.com"
end
end
it
"
should create
new user"
do
it
"
creates
new user"
do
expect
{
click_button
"Create user"
}.
to
change
{
User
.
count
}.
by
(
1
)
expect
{
click_button
"Create user"
}.
to
change
{
User
.
count
}.
by
(
1
)
end
end
it
"
should apply
defaults to user"
do
it
"
applies
defaults to user"
do
click_button
"Create user"
click_button
"Create user"
user
=
User
.
find_by
(
username:
'bang'
)
user
=
User
.
find_by
(
username:
'bang'
)
expect
(
user
.
projects_limit
).
expect
(
user
.
projects_limit
).
...
@@ -79,20 +79,20 @@ describe "Admin::Users", feature: true do
...
@@ -79,20 +79,20 @@ describe "Admin::Users", feature: true do
to
eq
(
Gitlab
.
config
.
gitlab
.
default_can_create_group
)
to
eq
(
Gitlab
.
config
.
gitlab
.
default_can_create_group
)
end
end
it
"
should create
user with valid data"
do
it
"
creates
user with valid data"
do
click_button
"Create user"
click_button
"Create user"
user
=
User
.
find_by
(
username:
'bang'
)
user
=
User
.
find_by
(
username:
'bang'
)
expect
(
user
.
name
).
to
eq
(
'Big Bang'
)
expect
(
user
.
name
).
to
eq
(
'Big Bang'
)
expect
(
user
.
email
).
to
eq
(
'bigbang@mail.com'
)
expect
(
user
.
email
).
to
eq
(
'bigbang@mail.com'
)
end
end
it
"
should call
send mail"
do
it
"
calls
send mail"
do
expect_any_instance_of
(
NotificationService
).
to
receive
(
:new_user
)
expect_any_instance_of
(
NotificationService
).
to
receive
(
:new_user
)
click_button
"Create user"
click_button
"Create user"
end
end
it
"s
hould send
valid email to user with email & password"
do
it
"s
ends
valid email to user with email & password"
do
perform_enqueued_jobs
do
perform_enqueued_jobs
do
click_button
"Create user"
click_button
"Create user"
end
end
...
@@ -106,7 +106,7 @@ describe "Admin::Users", feature: true do
...
@@ -106,7 +106,7 @@ describe "Admin::Users", feature: true do
end
end
describe
"GET /admin/users/:id"
do
describe
"GET /admin/users/:id"
do
it
"
should have
user info"
do
it
"
has
user info"
do
visit
admin_users_path
visit
admin_users_path
click_link
@user
.
name
click_link
@user
.
name
...
@@ -123,13 +123,13 @@ describe "Admin::Users", feature: true do
...
@@ -123,13 +123,13 @@ describe "Admin::Users", feature: true do
expect
(
page
).
to
have_content
(
'Impersonate'
)
expect
(
page
).
to
have_content
(
'Impersonate'
)
end
end
it
'
should
not show impersonate button for admin itself'
do
it
'
does
not show impersonate button for admin itself'
do
visit
admin_user_path
(
@user
)
visit
admin_user_path
(
@user
)
expect
(
page
).
not_to
have_content
(
'Impersonate'
)
expect
(
page
).
not_to
have_content
(
'Impersonate'
)
end
end
it
'
should
not show impersonate button for blocked user'
do
it
'
does
not show impersonate button for blocked user'
do
another_user
.
block
another_user
.
block
visit
admin_user_path
(
another_user
)
visit
admin_user_path
(
another_user
)
...
@@ -153,7 +153,7 @@ describe "Admin::Users", feature: true do
...
@@ -153,7 +153,7 @@ describe "Admin::Users", feature: true do
expect
(
icon
).
not_to
eql
nil
expect
(
icon
).
not_to
eql
nil
end
end
it
'
can log
out of impersonated user back to original user'
do
it
'
logs
out of impersonated user back to original user'
do
find
(
:css
,
'li.impersonation a'
).
click
find
(
:css
,
'li.impersonation a'
).
click
expect
(
page
.
find
(
:css
,
'.header-user .profile-link'
)[
'data-user'
]).
to
eql
(
@user
.
username
)
expect
(
page
.
find
(
:css
,
'.header-user .profile-link'
)[
'data-user'
]).
to
eql
(
@user
.
username
)
...
@@ -197,7 +197,7 @@ describe "Admin::Users", feature: true do
...
@@ -197,7 +197,7 @@ describe "Admin::Users", feature: true do
click_link
"edit_user_
#{
@simple_user
.
id
}
"
click_link
"edit_user_
#{
@simple_user
.
id
}
"
end
end
it
"
should have
user edit page"
do
it
"
has
user edit page"
do
expect
(
page
).
to
have_content
(
'Name'
)
expect
(
page
).
to
have_content
(
'Name'
)
expect
(
page
).
to
have_content
(
'Password'
)
expect
(
page
).
to
have_content
(
'Password'
)
end
end
...
@@ -212,12 +212,12 @@ describe "Admin::Users", feature: true do
...
@@ -212,12 +212,12 @@ describe "Admin::Users", feature: true do
click_button
"Save changes"
click_button
"Save changes"
end
end
it
"sho
uld show
page with new data"
do
it
"sho
ws
page with new data"
do
expect
(
page
).
to
have_content
(
'bigbang@mail.com'
)
expect
(
page
).
to
have_content
(
'bigbang@mail.com'
)
expect
(
page
).
to
have_content
(
'Big Bang'
)
expect
(
page
).
to
have_content
(
'Big Bang'
)
end
end
it
"
should change
user entry"
do
it
"
changes
user entry"
do
@simple_user
.
reload
@simple_user
.
reload
expect
(
@simple_user
.
name
).
to
eq
(
'Big Bang'
)
expect
(
@simple_user
.
name
).
to
eq
(
'Big Bang'
)
expect
(
@simple_user
.
is_admin?
).
to
be_truthy
expect
(
@simple_user
.
is_admin?
).
to
be_truthy
...
...
spec/features/atom/dashboard_spec.rb
View file @
519275c1
...
@@ -5,7 +5,7 @@ describe "Dashboard Feed", feature: true do
...
@@ -5,7 +5,7 @@ describe "Dashboard Feed", feature: true do
let!
(
:user
)
{
create
(
:user
,
name:
"Jonh"
)
}
let!
(
:user
)
{
create
(
:user
,
name:
"Jonh"
)
}
context
"projects atom feed via private token"
do
context
"projects atom feed via private token"
do
it
"
should render
projects atom feed"
do
it
"
renders
projects atom feed"
do
visit
dashboard_projects_path
(
:atom
,
private_token:
user
.
private_token
)
visit
dashboard_projects_path
(
:atom
,
private_token:
user
.
private_token
)
expect
(
body
).
to
have_selector
(
'feed title'
)
expect
(
body
).
to
have_selector
(
'feed title'
)
end
end
...
@@ -23,11 +23,11 @@ describe "Dashboard Feed", feature: true do
...
@@ -23,11 +23,11 @@ describe "Dashboard Feed", feature: true do
visit
dashboard_projects_path
(
:atom
,
private_token:
user
.
private_token
)
visit
dashboard_projects_path
(
:atom
,
private_token:
user
.
private_token
)
end
end
it
"
should have
issue opened event"
do
it
"
has
issue opened event"
do
expect
(
body
).
to
have_content
(
"
#{
user
.
name
}
opened issue #
#{
issue
.
iid
}
"
)
expect
(
body
).
to
have_content
(
"
#{
user
.
name
}
opened issue #
#{
issue
.
iid
}
"
)
end
end
it
"
should have
issue comment event"
do
it
"
has
issue comment event"
do
expect
(
body
).
expect
(
body
).
to
have_content
(
"
#{
user
.
name
}
commented on issue #
#{
issue
.
iid
}
"
)
to
have_content
(
"
#{
user
.
name
}
commented on issue #
#{
issue
.
iid
}
"
)
end
end
...
...
spec/features/atom/issues_spec.rb
View file @
519275c1
...
@@ -9,7 +9,7 @@ describe 'Issues Feed', feature: true do
...
@@ -9,7 +9,7 @@ describe 'Issues Feed', feature: true do
before
{
project
.
team
<<
[
user
,
:developer
]
}
before
{
project
.
team
<<
[
user
,
:developer
]
}
context
'when authenticated'
do
context
'when authenticated'
do
it
'
should render
atom feed'
do
it
'
renders
atom feed'
do
login_with
user
login_with
user
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
:atom
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
:atom
)
...
@@ -22,7 +22,7 @@ describe 'Issues Feed', feature: true do
...
@@ -22,7 +22,7 @@ describe 'Issues Feed', feature: true do
end
end
context
'when authenticated via private token'
do
context
'when authenticated via private token'
do
it
'
should render
atom feed'
do
it
'
renders
atom feed'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
:atom
,
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
:atom
,
private_token:
user
.
private_token
)
private_token:
user
.
private_token
)
...
...
spec/features/atom/users_spec.rb
View file @
519275c1
...
@@ -5,7 +5,7 @@ describe "User Feed", feature: true do
...
@@ -5,7 +5,7 @@ describe "User Feed", feature: true do
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:user
)
{
create
(
:user
)
}
context
'user atom feed via private token'
do
context
'user atom feed via private token'
do
it
"
should render
user atom feed"
do
it
"
renders
user atom feed"
do
visit
user_path
(
user
,
:atom
,
private_token:
user
.
private_token
)
visit
user_path
(
user
,
:atom
,
private_token:
user
.
private_token
)
expect
(
body
).
to
have_selector
(
'feed title'
)
expect
(
body
).
to
have_selector
(
'feed title'
)
end
end
...
@@ -43,24 +43,24 @@ describe "User Feed", feature: true do
...
@@ -43,24 +43,24 @@ describe "User Feed", feature: true do
visit
user_path
(
user
,
:atom
,
private_token:
user
.
private_token
)
visit
user_path
(
user
,
:atom
,
private_token:
user
.
private_token
)
end
end
it
'
should have
issue opened event'
do
it
'
has
issue opened event'
do
expect
(
body
).
to
have_content
(
"
#{
safe_name
}
opened issue #
#{
issue
.
iid
}
"
)
expect
(
body
).
to
have_content
(
"
#{
safe_name
}
opened issue #
#{
issue
.
iid
}
"
)
end
end
it
'
should have
issue comment event'
do
it
'
has
issue comment event'
do
expect
(
body
).
expect
(
body
).
to
have_content
(
"
#{
safe_name
}
commented on issue #
#{
issue
.
iid
}
"
)
to
have_content
(
"
#{
safe_name
}
commented on issue #
#{
issue
.
iid
}
"
)
end
end
it
'
should have
XHTML summaries in issue descriptions'
do
it
'
has
XHTML summaries in issue descriptions'
do
expect
(
body
).
to
match
/we have a bug!<\/p>\n\n<hr ?\/>\n\n<p>I guess/
expect
(
body
).
to
match
/we have a bug!<\/p>\n\n<hr ?\/>\n\n<p>I guess/
end
end
it
'
should have
XHTML summaries in notes'
do
it
'
has
XHTML summaries in notes'
do
expect
(
body
).
to
match
/Bug confirmed <img[^>]*\/>/
expect
(
body
).
to
match
/Bug confirmed <img[^>]*\/>/
end
end
it
'
should have
XHTML summaries in merge request descriptions'
do
it
'
has
XHTML summaries in merge request descriptions'
do
expect
(
body
).
to
match
/Here is the fix: <\/p><div[^>]*><a[^>]*><img[^>]*\/><\/a><\/div>/
expect
(
body
).
to
match
/Here is the fix: <\/p><div[^>]*><a[^>]*><img[^>]*\/><\/a><\/div>/
end
end
end
end
...
...
spec/features/ci_lint_spec.rb
View file @
519275c1
...
@@ -17,7 +17,7 @@ describe 'CI Lint' do
...
@@ -17,7 +17,7 @@ describe 'CI Lint' do
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
end
end
it
'
Yaml parsing
'
do
it
'
parses Yaml
'
do
within
"table"
do
within
"table"
do
expect
(
page
).
to
have_content
(
'Job - rspec'
)
expect
(
page
).
to
have_content
(
'Job - rspec'
)
expect
(
page
).
to
have_content
(
'Job - spinach'
)
expect
(
page
).
to
have_content
(
'Job - spinach'
)
...
...
spec/features/commits_spec.rb
View file @
519275c1
...
@@ -52,7 +52,7 @@ describe 'Commits' do
...
@@ -52,7 +52,7 @@ describe 'Commits' do
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
:master
)
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
:master
)
end
end
it
'sho
uld show
build status'
do
it
'sho
ws
build status'
do
page
.
within
(
"//li[@id='commit-
#{
pipeline
.
short_sha
}
']"
)
do
page
.
within
(
"//li[@id='commit-
#{
pipeline
.
short_sha
}
']"
)
do
expect
(
page
).
to
have_css
(
".ci-status-link"
)
expect
(
page
).
to
have_css
(
".ci-status-link"
)
end
end
...
...
spec/features/compare_spec.rb
View file @
519275c1
...
@@ -11,11 +11,11 @@ describe "Compare", js: true do
...
@@ -11,11 +11,11 @@ describe "Compare", js: true do
end
end
describe
"branches"
do
describe
"branches"
do
it
"
should pre-populate
fields"
do
it
"
pre-populates
fields"
do
expect
(
page
.
find_field
(
"from"
).
value
).
to
eq
(
"master"
)
expect
(
page
.
find_field
(
"from"
).
value
).
to
eq
(
"master"
)
end
end
it
"
should compare
branches"
do
it
"
compares
branches"
do
fill_in
"from"
,
with:
"fea"
fill_in
"from"
,
with:
"fea"
find
(
"#from"
).
click
find
(
"#from"
).
click
...
@@ -28,7 +28,7 @@ describe "Compare", js: true do
...
@@ -28,7 +28,7 @@ describe "Compare", js: true do
end
end
describe
"tags"
do
describe
"tags"
do
it
"
should compare
tags"
do
it
"
compares
tags"
do
fill_in
"from"
,
with:
"v1.0"
fill_in
"from"
,
with:
"v1.0"
find
(
"#from"
).
click
find
(
"#from"
).
click
...
...
spec/features/dashboard/label_filter_spec.rb
View file @
519275c1
...
@@ -16,7 +16,7 @@ describe 'Dashboard > label filter', feature: true, js: true do
...
@@ -16,7 +16,7 @@ describe 'Dashboard > label filter', feature: true, js: true do
end
end
context
'duplicate labels'
do
context
'duplicate labels'
do
it
'
should remove
duplicate labels'
do
it
'
removes
duplicate labels'
do
page
.
within
(
'.labels-filter'
)
do
page
.
within
(
'.labels-filter'
)
do
click_button
'Label'
click_button
'Label'
end
end
...
...
spec/features/dashboard_issues_spec.rb
View file @
519275c1
...
@@ -16,7 +16,7 @@ describe "Dashboard Issues filtering", feature: true, js: true do
...
@@ -16,7 +16,7 @@ describe "Dashboard Issues filtering", feature: true, js: true do
visit_issues
visit_issues
end
end
it
'sho
uld show
all issues with no milestone'
do
it
'sho
ws
all issues with no milestone'
do
show_milestone_dropdown
show_milestone_dropdown
click_link
'No Milestone'
click_link
'No Milestone'
...
@@ -24,7 +24,7 @@ describe "Dashboard Issues filtering", feature: true, js: true do
...
@@ -24,7 +24,7 @@ describe "Dashboard Issues filtering", feature: true, js: true do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
1
)
end
end
it
'sho
uld show
all issues with any milestone'
do
it
'sho
ws
all issues with any milestone'
do
show_milestone_dropdown
show_milestone_dropdown
click_link
'Any Milestone'
click_link
'Any Milestone'
...
@@ -32,7 +32,7 @@ describe "Dashboard Issues filtering", feature: true, js: true do
...
@@ -32,7 +32,7 @@ describe "Dashboard Issues filtering", feature: true, js: true do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
2
)
end
end
it
'sho
uld show
all issues with the selected milestone'
do
it
'sho
ws
all issues with the selected milestone'
do
show_milestone_dropdown
show_milestone_dropdown
page
.
within
'.dropdown-content'
do
page
.
within
'.dropdown-content'
do
...
...
spec/features/gitlab_flavored_markdown_spec.rb
View file @
519275c1
...
@@ -23,25 +23,25 @@ describe "GitLab Flavored Markdown", feature: true do
...
@@ -23,25 +23,25 @@ describe "GitLab Flavored Markdown", feature: true do
end
end
describe
"for commits"
do
describe
"for commits"
do
it
"
should render
title in commits#index"
do
it
"
renders
title in commits#index"
do
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
'master'
,
limit:
1
)
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
'master'
,
limit:
1
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
end
end
it
"
should render
title in commits#show"
do
it
"
renders
title in commits#show"
do
visit
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
visit
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
end
end
it
"
should render
description in commits#show"
do
it
"
renders
description in commits#show"
do
visit
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
visit
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
expect
(
page
).
to
have_link
(
fred
.
to_reference
)
expect
(
page
).
to
have_link
(
fred
.
to_reference
)
end
end
it
"
should render
title in repositories#branches"
do
it
"
renders
title in repositories#branches"
do
visit
namespace_project_branches_path
(
project
.
namespace
,
project
)
visit
namespace_project_branches_path
(
project
.
namespace
,
project
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
...
@@ -62,19 +62,19 @@ describe "GitLab Flavored Markdown", feature: true do
...
@@ -62,19 +62,19 @@ describe "GitLab Flavored Markdown", feature: true do
description:
"ask
#{
fred
.
to_reference
}
for details"
)
description:
"ask
#{
fred
.
to_reference
}
for details"
)
end
end
it
"
should render
subject in issues#index"
do
it
"
renders
subject in issues#index"
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
expect
(
page
).
to
have_link
(
@other_issue
.
to_reference
)
expect
(
page
).
to
have_link
(
@other_issue
.
to_reference
)
end
end
it
"
should render
subject in issues#show"
do
it
"
renders
subject in issues#show"
do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
@issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
@issue
)
expect
(
page
).
to
have_link
(
@other_issue
.
to_reference
)
expect
(
page
).
to
have_link
(
@other_issue
.
to_reference
)
end
end
it
"
should render
details in issues#show"
do
it
"
renders
details in issues#show"
do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
@issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
@issue
)
expect
(
page
).
to
have_link
(
fred
.
to_reference
)
expect
(
page
).
to
have_link
(
fred
.
to_reference
)
...
@@ -86,13 +86,13 @@ describe "GitLab Flavored Markdown", feature: true do
...
@@ -86,13 +86,13 @@ describe "GitLab Flavored Markdown", feature: true do
@merge_request
=
create
(
:merge_request
,
source_project:
project
,
target_project:
project
,
title:
"fix
#{
issue
.
to_reference
}
"
)
@merge_request
=
create
(
:merge_request
,
source_project:
project
,
target_project:
project
,
title:
"fix
#{
issue
.
to_reference
}
"
)
end
end
it
"
should render
title in merge_requests#index"
do
it
"
renders
title in merge_requests#index"
do
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
end
end
it
"
should render
title in merge_requests#show"
do
it
"
renders
title in merge_requests#show"
do
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
@merge_request
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
@merge_request
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
...
@@ -107,19 +107,19 @@ describe "GitLab Flavored Markdown", feature: true do
...
@@ -107,19 +107,19 @@ describe "GitLab Flavored Markdown", feature: true do
description:
"ask
#{
fred
.
to_reference
}
for details"
)
description:
"ask
#{
fred
.
to_reference
}
for details"
)
end
end
it
"
should render
title in milestones#index"
do
it
"
renders
title in milestones#index"
do
visit
namespace_project_milestones_path
(
project
.
namespace
,
project
)
visit
namespace_project_milestones_path
(
project
.
namespace
,
project
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
end
end
it
"
should render
title in milestones#show"
do
it
"
renders
title in milestones#show"
do
visit
namespace_project_milestone_path
(
project
.
namespace
,
project
,
@milestone
)
visit
namespace_project_milestone_path
(
project
.
namespace
,
project
,
@milestone
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
expect
(
page
).
to
have_link
(
issue
.
to_reference
)
end
end
it
"
should render
description in milestones#show"
do
it
"
renders
description in milestones#show"
do
visit
namespace_project_milestone_path
(
project
.
namespace
,
project
,
@milestone
)
visit
namespace_project_milestone_path
(
project
.
namespace
,
project
,
@milestone
)
expect
(
page
).
to
have_link
(
fred
.
to_reference
)
expect
(
page
).
to
have_link
(
fred
.
to_reference
)
...
...
spec/features/help_pages_spec.rb
View file @
519275c1
...
@@ -5,7 +5,7 @@ describe 'Help Pages', feature: true do
...
@@ -5,7 +5,7 @@ describe 'Help Pages', feature: true do
before
do
before
do
login_as
:user
login_as
:user
end
end
it
'replace the variable $your_email with the email of the user'
do
it
'replace
s
the variable $your_email with the email of the user'
do
visit
help_page_path
(
'ssh/README'
)
visit
help_page_path
(
'ssh/README'
)
expect
(
page
).
to
have_content
(
"ssh-keygen -t rsa -C
\"
#{
@user
.
email
}
\"
"
)
expect
(
page
).
to
have_content
(
"ssh-keygen -t rsa -C
\"
#{
@user
.
email
}
\"
"
)
end
end
...
...
spec/features/issues/award_emoji_spec.rb
View file @
519275c1
...
@@ -21,32 +21,32 @@ describe 'Awards Emoji', feature: true do
...
@@ -21,32 +21,32 @@ describe 'Awards Emoji', feature: true do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
end
it
'
should increment
the thumbsdown emoji'
,
js:
true
do
it
'
increments
the thumbsdown emoji'
,
js:
true
do
find
(
'[data-emoji="thumbsdown"]'
).
click
find
(
'[data-emoji="thumbsdown"]'
).
click
sleep
2
sleep
2
expect
(
thumbsdown_emoji
).
to
have_text
(
"1"
)
expect
(
thumbsdown_emoji
).
to
have_text
(
"1"
)
end
end
context
'click the thumbsup emoji'
do
context
'click the thumbsup emoji'
do
it
'
should increment
the thumbsup emoji'
,
js:
true
do
it
'
increments
the thumbsup emoji'
,
js:
true
do
find
(
'[data-emoji="thumbsup"]'
).
click
find
(
'[data-emoji="thumbsup"]'
).
click
sleep
2
sleep
2
expect
(
thumbsup_emoji
).
to
have_text
(
"1"
)
expect
(
thumbsup_emoji
).
to
have_text
(
"1"
)
end
end
it
'
should decrement
the thumbsdown emoji'
,
js:
true
do
it
'
decrements
the thumbsdown emoji'
,
js:
true
do
expect
(
thumbsdown_emoji
).
to
have_text
(
"0"
)
expect
(
thumbsdown_emoji
).
to
have_text
(
"0"
)
end
end
end
end
context
'click the thumbsdown emoji'
do
context
'click the thumbsdown emoji'
do
it
'
should increment
the thumbsdown emoji'
,
js:
true
do
it
'
increments
the thumbsdown emoji'
,
js:
true
do
find
(
'[data-emoji="thumbsdown"]'
).
click
find
(
'[data-emoji="thumbsdown"]'
).
click
sleep
2
sleep
2
expect
(
thumbsdown_emoji
).
to
have_text
(
"1"
)
expect
(
thumbsdown_emoji
).
to
have_text
(
"1"
)
end
end
it
'
should decrement
the thumbsup emoji'
,
js:
true
do
it
'
decrements
the thumbsup emoji'
,
js:
true
do
expect
(
thumbsup_emoji
).
to
have_text
(
"0"
)
expect
(
thumbsup_emoji
).
to
have_text
(
"0"
)
end
end
end
end
...
...
spec/features/issues/award_spec.rb
View file @
519275c1
...
@@ -11,7 +11,7 @@ feature 'Issue awards', js: true, feature: true do
...
@@ -11,7 +11,7 @@ feature 'Issue awards', js: true, feature: true do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
end
it
'
should add
award to issue'
do
it
'
adds
award to issue'
do
first
(
'.js-emoji-btn'
).
click
first
(
'.js-emoji-btn'
).
click
expect
(
page
).
to
have_selector
(
'.js-emoji-btn.active'
)
expect
(
page
).
to
have_selector
(
'.js-emoji-btn.active'
)
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'1'
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'1'
...
@@ -20,7 +20,7 @@ feature 'Issue awards', js: true, feature: true do
...
@@ -20,7 +20,7 @@ feature 'Issue awards', js: true, feature: true do
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'1'
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'1'
end
end
it
'
should remove
award from issue'
do
it
'
removes
award from issue'
do
first
(
'.js-emoji-btn'
).
click
first
(
'.js-emoji-btn'
).
click
find
(
'.js-emoji-btn.active'
).
click
find
(
'.js-emoji-btn.active'
).
click
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'0'
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'0'
...
@@ -29,7 +29,7 @@ feature 'Issue awards', js: true, feature: true do
...
@@ -29,7 +29,7 @@ feature 'Issue awards', js: true, feature: true do
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'0'
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'0'
end
end
it
'
should only have
one menu on the page'
do
it
'
only has
one menu on the page'
do
first
(
'.js-add-award'
).
click
first
(
'.js-add-award'
).
click
expect
(
page
).
to
have_selector
(
'.emoji-menu'
)
expect
(
page
).
to
have_selector
(
'.emoji-menu'
)
...
@@ -42,7 +42,7 @@ feature 'Issue awards', js: true, feature: true do
...
@@ -42,7 +42,7 @@ feature 'Issue awards', js: true, feature: true do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
end
it
'
should
not see award menu button'
do
it
'
does
not see award menu button'
do
expect
(
page
).
not_to
have_selector
(
'.js-award-holder'
)
expect
(
page
).
not_to
have_selector
(
'.js-award-holder'
)
end
end
end
end
...
...
spec/features/issues/bulk_assignment_labels_spec.rb
View file @
519275c1
...
@@ -175,7 +175,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
...
@@ -175,7 +175,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
end
it
'
labels are kept
'
do
it
'
keeps labels
'
do
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'feature'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'feature'
...
@@ -197,7 +197,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
...
@@ -197,7 +197,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
end
it
'
existing label is kept
and new label is present'
do
it
'
keeps existing label
and new label is present'
do
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
check
'check_all_issues'
check
'check_all_issues'
...
@@ -222,7 +222,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
...
@@ -222,7 +222,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
end
it
'
existing label is kept
and new label is present'
do
it
'
keeps existing label
and new label is present'
do
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'feature'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'feature'
...
@@ -252,7 +252,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
...
@@ -252,7 +252,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
end
it
'
labels are kept
'
do
it
'
keeps labels
'
do
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'First Release'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'First Release'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'feature'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'feature'
...
...
spec/features/issues/filter_by_labels_spec.rb
View file @
519275c1
...
@@ -37,25 +37,25 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -37,25 +37,25 @@ feature 'Issue filtering by Labels', feature: true do
wait_for_ajax
wait_for_ajax
end
end
it
'sho
uld show
issue "Bugfix1" and "Bugfix2" in issues list'
do
it
'sho
ws
issue "Bugfix1" and "Bugfix2" in issues list'
do
expect
(
page
).
to
have_content
"Bugfix1"
expect
(
page
).
to
have_content
"Bugfix1"
expect
(
page
).
to
have_content
"Bugfix2"
expect
(
page
).
to
have_content
"Bugfix2"
end
end
it
'
should
not show "Feature1" in issues list'
do
it
'
does
not show "Feature1" in issues list'
do
expect
(
page
).
not_to
have_content
"Feature1"
expect
(
page
).
not_to
have_content
"Feature1"
end
end
it
'sho
uld show
label "bug" in filtered-labels'
do
it
'sho
ws
label "bug" in filtered-labels'
do
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"bug"
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"bug"
end
end
it
'
should
not show label "feature" and "enhancement" in filtered-labels'
do
it
'
does
not show label "feature" and "enhancement" in filtered-labels'
do
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"feature"
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"feature"
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"enhancement"
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"enhancement"
end
end
it
'
should remove
label "bug"'
do
it
'
removes
label "bug"'
do
find
(
'.js-label-filter-remove'
).
click
find
(
'.js-label-filter-remove'
).
click
wait_for_ajax
wait_for_ajax
expect
(
find
(
'.filtered-labels'
,
visible:
false
)).
to
have_no_content
"bug"
expect
(
find
(
'.filtered-labels'
,
visible:
false
)).
to
have_no_content
"bug"
...
@@ -71,20 +71,20 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -71,20 +71,20 @@ feature 'Issue filtering by Labels', feature: true do
wait_for_ajax
wait_for_ajax
end
end
it
'sho
uld show
issue "Feature1" in issues list'
do
it
'sho
ws
issue "Feature1" in issues list'
do
expect
(
page
).
to
have_content
"Feature1"
expect
(
page
).
to
have_content
"Feature1"
end
end
it
'
should
not show "Bugfix1" and "Bugfix2" in issues list'
do
it
'
does
not show "Bugfix1" and "Bugfix2" in issues list'
do
expect
(
page
).
not_to
have_content
"Bugfix2"
expect
(
page
).
not_to
have_content
"Bugfix2"
expect
(
page
).
not_to
have_content
"Bugfix1"
expect
(
page
).
not_to
have_content
"Bugfix1"
end
end
it
'sho
uld show
label "feature" in filtered-labels'
do
it
'sho
ws
label "feature" in filtered-labels'
do
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"feature"
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"feature"
end
end
it
'
should
not show label "bug" and "enhancement" in filtered-labels'
do
it
'
does
not show label "bug" and "enhancement" in filtered-labels'
do
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"bug"
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"bug"
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"enhancement"
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"enhancement"
end
end
...
@@ -99,20 +99,20 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -99,20 +99,20 @@ feature 'Issue filtering by Labels', feature: true do
wait_for_ajax
wait_for_ajax
end
end
it
'sho
uld show
issue "Bugfix2" in issues list'
do
it
'sho
ws
issue "Bugfix2" in issues list'
do
expect
(
page
).
to
have_content
"Bugfix2"
expect
(
page
).
to
have_content
"Bugfix2"
end
end
it
'
should
not show "Feature1" and "Bugfix1" in issues list'
do
it
'
does
not show "Feature1" and "Bugfix1" in issues list'
do
expect
(
page
).
not_to
have_content
"Feature1"
expect
(
page
).
not_to
have_content
"Feature1"
expect
(
page
).
not_to
have_content
"Bugfix1"
expect
(
page
).
not_to
have_content
"Bugfix1"
end
end
it
'sho
uld show
label "enhancement" in filtered-labels'
do
it
'sho
ws
label "enhancement" in filtered-labels'
do
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"enhancement"
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"enhancement"
end
end
it
'
should
not show label "feature" and "bug" in filtered-labels'
do
it
'
does
not show label "feature" and "bug" in filtered-labels'
do
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"bug"
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"bug"
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"feature"
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"feature"
end
end
...
@@ -128,21 +128,21 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -128,21 +128,21 @@ feature 'Issue filtering by Labels', feature: true do
wait_for_ajax
wait_for_ajax
end
end
it
'
should
not show "Bugfix1" or "Feature1" in issues list'
do
it
'
does
not show "Bugfix1" or "Feature1" in issues list'
do
expect
(
page
).
not_to
have_content
"Bugfix1"
expect
(
page
).
not_to
have_content
"Bugfix1"
expect
(
page
).
not_to
have_content
"Feature1"
expect
(
page
).
not_to
have_content
"Feature1"
end
end
it
'sho
uld show
label "enhancement" and "feature" in filtered-labels'
do
it
'sho
ws
label "enhancement" and "feature" in filtered-labels'
do
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"enhancement"
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"enhancement"
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"feature"
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"feature"
end
end
it
'
should
not show label "bug" in filtered-labels'
do
it
'
does
not show label "bug" in filtered-labels'
do
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"bug"
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"bug"
end
end
it
'
should remove
label "enhancement"'
do
it
'
removes
label "enhancement"'
do
find
(
'.js-label-filter-remove'
,
match: :first
).
click
find
(
'.js-label-filter-remove'
,
match: :first
).
click
wait_for_ajax
wait_for_ajax
expect
(
find
(
'.filtered-labels'
)).
to
have_no_content
"enhancement"
expect
(
find
(
'.filtered-labels'
)).
to
have_no_content
"enhancement"
...
@@ -159,20 +159,20 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -159,20 +159,20 @@ feature 'Issue filtering by Labels', feature: true do
wait_for_ajax
wait_for_ajax
end
end
it
'sho
uld show
issue "Bugfix2" in issues list'
do
it
'sho
ws
issue "Bugfix2" in issues list'
do
expect
(
page
).
to
have_content
"Bugfix2"
expect
(
page
).
to
have_content
"Bugfix2"
end
end
it
'
should
not show "Feature1"'
do
it
'
does
not show "Feature1"'
do
expect
(
page
).
not_to
have_content
"Feature1"
expect
(
page
).
not_to
have_content
"Feature1"
end
end
it
'sho
uld show
label "bug" and "enhancement" in filtered-labels'
do
it
'sho
ws
label "bug" and "enhancement" in filtered-labels'
do
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"bug"
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"bug"
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"enhancement"
expect
(
find
(
'.filtered-labels'
)).
to
have_content
"enhancement"
end
end
it
'
should
not show label "feature" in filtered-labels'
do
it
'
does
not show label "feature" in filtered-labels'
do
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"feature"
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"feature"
end
end
end
end
...
@@ -191,7 +191,7 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -191,7 +191,7 @@ feature 'Issue filtering by Labels', feature: true do
end
end
end
end
it
'
should allow
user to remove filtered labels'
do
it
'
allows
user to remove filtered labels'
do
first
(
'.js-label-filter-remove'
).
click
first
(
'.js-label-filter-remove'
).
click
wait_for_ajax
wait_for_ajax
...
@@ -201,7 +201,7 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -201,7 +201,7 @@ feature 'Issue filtering by Labels', feature: true do
end
end
context
'dropdown filtering'
,
js:
true
do
context
'dropdown filtering'
,
js:
true
do
it
'
should filter
by label name'
do
it
'
filters
by label name'
do
page
.
within
'.labels-filter'
do
page
.
within
'.labels-filter'
do
click_button
'Label'
click_button
'Label'
wait_for_ajax
wait_for_ajax
...
...
spec/features/issues/filter_by_milestone_spec.rb
View file @
519275c1
...
@@ -15,7 +15,7 @@ feature 'Issue filtering by Milestone', feature: true do
...
@@ -15,7 +15,7 @@ feature 'Issue filtering by Milestone', feature: true do
end
end
context
'filters by upcoming milestone'
,
js:
true
do
context
'filters by upcoming milestone'
,
js:
true
do
it
'
should
not show issues with no expiry'
do
it
'
does
not show issues with no expiry'
do
create
(
:issue
,
project:
project
)
create
(
:issue
,
project:
project
)
create
(
:issue
,
project:
project
,
milestone:
milestone
)
create
(
:issue
,
project:
project
,
milestone:
milestone
)
...
@@ -25,7 +25,7 @@ feature 'Issue filtering by Milestone', feature: true do
...
@@ -25,7 +25,7 @@ feature 'Issue filtering by Milestone', feature: true do
expect
(
page
).
to
have_css
(
'.issue'
,
count:
0
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
0
)
end
end
it
'sho
uld show
issues in future'
do
it
'sho
ws
issues in future'
do
milestone
=
create
(
:milestone
,
project:
project
,
due_date:
Date
.
tomorrow
)
milestone
=
create
(
:milestone
,
project:
project
,
due_date:
Date
.
tomorrow
)
create
(
:issue
,
project:
project
)
create
(
:issue
,
project:
project
)
create
(
:issue
,
project:
project
,
milestone:
milestone
)
create
(
:issue
,
project:
project
,
milestone:
milestone
)
...
@@ -36,7 +36,7 @@ feature 'Issue filtering by Milestone', feature: true do
...
@@ -36,7 +36,7 @@ feature 'Issue filtering by Milestone', feature: true do
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
end
end
it
'
should
not show issues in past'
do
it
'
does
not show issues in past'
do
milestone
=
create
(
:milestone
,
project:
project
,
due_date:
Date
.
yesterday
)
milestone
=
create
(
:milestone
,
project:
project
,
due_date:
Date
.
yesterday
)
create
(
:issue
,
project:
project
)
create
(
:issue
,
project:
project
)
create
(
:issue
,
project:
project
,
milestone:
milestone
)
create
(
:issue
,
project:
project
,
milestone:
milestone
)
...
...
spec/features/issues/filter_issues_spec.rb
View file @
519275c1
...
@@ -26,17 +26,17 @@ describe 'Filter issues', feature: true do
...
@@ -26,17 +26,17 @@ describe 'Filter issues', feature: true do
end
end
context
'assignee'
,
js:
true
do
context
'assignee'
,
js:
true
do
it
'
should update
to current user'
do
it
'
updates
to current user'
do
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
end
end
it
'
should
not change when closed link is clicked'
do
it
'
does
not change when closed link is clicked'
do
find
(
'.issues-state-filters a'
,
text:
"Closed"
).
click
find
(
'.issues-state-filters a'
,
text:
"Closed"
).
click
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
end
end
it
'
should
not change when all link is clicked'
do
it
'
does
not change when all link is clicked'
do
find
(
'.issues-state-filters a'
,
text:
"All"
).
click
find
(
'.issues-state-filters a'
,
text:
"All"
).
click
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
...
@@ -56,17 +56,17 @@ describe 'Filter issues', feature: true do
...
@@ -56,17 +56,17 @@ describe 'Filter issues', feature: true do
end
end
context
'milestone'
,
js:
true
do
context
'milestone'
,
js:
true
do
it
'
should update
to current milestone'
do
it
'
updates
to current milestone'
do
expect
(
find
(
'.js-milestone-select .dropdown-toggle-text'
)).
to
have_content
(
milestone
.
title
)
expect
(
find
(
'.js-milestone-select .dropdown-toggle-text'
)).
to
have_content
(
milestone
.
title
)
end
end
it
'
should
not change when closed link is clicked'
do
it
'
does
not change when closed link is clicked'
do
find
(
'.issues-state-filters a'
,
text:
"Closed"
).
click
find
(
'.issues-state-filters a'
,
text:
"Closed"
).
click
expect
(
find
(
'.js-milestone-select .dropdown-toggle-text'
)).
to
have_content
(
milestone
.
title
)
expect
(
find
(
'.js-milestone-select .dropdown-toggle-text'
)).
to
have_content
(
milestone
.
title
)
end
end
it
'
should
not change when all link is clicked'
do
it
'
does
not change when all link is clicked'
do
find
(
'.issues-state-filters a'
,
text:
"All"
).
click
find
(
'.issues-state-filters a'
,
text:
"All"
).
click
expect
(
find
(
'.js-milestone-select .dropdown-toggle-text'
)).
to
have_content
(
milestone
.
title
)
expect
(
find
(
'.js-milestone-select .dropdown-toggle-text'
)).
to
have_content
(
milestone
.
title
)
...
@@ -81,7 +81,7 @@ describe 'Filter issues', feature: true do
...
@@ -81,7 +81,7 @@ describe 'Filter issues', feature: true do
wait_for_ajax
wait_for_ajax
end
end
it
'
should filter
by any label'
do
it
'
filters
by any label'
do
find
(
'.dropdown-menu-labels a'
,
text:
'Any Label'
).
click
find
(
'.dropdown-menu-labels a'
,
text:
'Any Label'
).
click
page
.
first
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
page
.
first
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
wait_for_ajax
wait_for_ajax
...
@@ -89,7 +89,7 @@ describe 'Filter issues', feature: true do
...
@@ -89,7 +89,7 @@ describe 'Filter issues', feature: true do
expect
(
find
(
'.labels-filter'
)).
to
have_content
'Label'
expect
(
find
(
'.labels-filter'
)).
to
have_content
'Label'
end
end
it
'
should filter
by no label'
do
it
'
filters
by no label'
do
find
(
'.dropdown-menu-labels a'
,
text:
'No Label'
).
click
find
(
'.dropdown-menu-labels a'
,
text:
'No Label'
).
click
page
.
first
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
page
.
first
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
wait_for_ajax
wait_for_ajax
...
@@ -100,7 +100,7 @@ describe 'Filter issues', feature: true do
...
@@ -100,7 +100,7 @@ describe 'Filter issues', feature: true do
expect
(
find
(
'.js-label-select .dropdown-toggle-text'
)).
to
have_content
(
'No Label'
)
expect
(
find
(
'.js-label-select .dropdown-toggle-text'
)).
to
have_content
(
'No Label'
)
end
end
it
'
should filter
by no label'
do
it
'
filters
by no label'
do
find
(
'.dropdown-menu-labels a'
,
text:
label
.
title
).
click
find
(
'.dropdown-menu-labels a'
,
text:
label
.
title
).
click
page
.
within
'.labels-filter'
do
page
.
within
'.labels-filter'
do
expect
(
page
).
to
have_content
label
.
title
expect
(
page
).
to
have_content
label
.
title
...
@@ -128,19 +128,19 @@ describe 'Filter issues', feature: true do
...
@@ -128,19 +128,19 @@ describe 'Filter issues', feature: true do
end
end
context
'assignee and label'
,
js:
true
do
context
'assignee and label'
,
js:
true
do
it
'
should update
to current assignee and label'
do
it
'
updates
to current assignee and label'
do
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-label-select .dropdown-toggle-text'
)).
to
have_content
(
label
.
title
)
expect
(
find
(
'.js-label-select .dropdown-toggle-text'
)).
to
have_content
(
label
.
title
)
end
end
it
'
should
not change when closed link is clicked'
do
it
'
does
not change when closed link is clicked'
do
find
(
'.issues-state-filters a'
,
text:
"Closed"
).
click
find
(
'.issues-state-filters a'
,
text:
"Closed"
).
click
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-label-select .dropdown-toggle-text'
)).
to
have_content
(
label
.
title
)
expect
(
find
(
'.js-label-select .dropdown-toggle-text'
)).
to
have_content
(
label
.
title
)
end
end
it
'
should
not change when all link is clicked'
do
it
'
does
not change when all link is clicked'
do
find
(
'.issues-state-filters a'
,
text:
"All"
).
click
find
(
'.issues-state-filters a'
,
text:
"All"
).
click
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
...
@@ -168,7 +168,7 @@ describe 'Filter issues', feature: true do
...
@@ -168,7 +168,7 @@ describe 'Filter issues', feature: true do
end
end
context
'only text'
,
js:
true
do
context
'only text'
,
js:
true
do
it
'
should filter
issues by searched text'
do
it
'
filters
issues by searched text'
do
fill_in
'issue_search'
,
with:
'Bug'
fill_in
'issue_search'
,
with:
'Bug'
page
.
within
'.issues-list'
do
page
.
within
'.issues-list'
do
...
@@ -176,7 +176,7 @@ describe 'Filter issues', feature: true do
...
@@ -176,7 +176,7 @@ describe 'Filter issues', feature: true do
end
end
end
end
it
'
should
not show any issues'
do
it
'
does
not show any issues'
do
fill_in
'issue_search'
,
with:
'testing'
fill_in
'issue_search'
,
with:
'testing'
page
.
within
'.issues-list'
do
page
.
within
'.issues-list'
do
...
@@ -186,7 +186,7 @@ describe 'Filter issues', feature: true do
...
@@ -186,7 +186,7 @@ describe 'Filter issues', feature: true do
end
end
context
'text and dropdown options'
,
js:
true
do
context
'text and dropdown options'
,
js:
true
do
it
'
should filter
by text and label'
do
it
'
filters
by text and label'
do
fill_in
'issue_search'
,
with:
'Bug'
fill_in
'issue_search'
,
with:
'Bug'
page
.
within
'.issues-list'
do
page
.
within
'.issues-list'
do
...
@@ -204,7 +204,7 @@ describe 'Filter issues', feature: true do
...
@@ -204,7 +204,7 @@ describe 'Filter issues', feature: true do
end
end
end
end
it
'
should filter
by text and milestone'
do
it
'
filters
by text and milestone'
do
fill_in
'issue_search'
,
with:
'Bug'
fill_in
'issue_search'
,
with:
'Bug'
page
.
within
'.issues-list'
do
page
.
within
'.issues-list'
do
...
@@ -221,7 +221,7 @@ describe 'Filter issues', feature: true do
...
@@ -221,7 +221,7 @@ describe 'Filter issues', feature: true do
end
end
end
end
it
'
should filter
by text and assignee'
do
it
'
filters
by text and assignee'
do
fill_in
'issue_search'
,
with:
'Bug'
fill_in
'issue_search'
,
with:
'Bug'
page
.
within
'.issues-list'
do
page
.
within
'.issues-list'
do
...
@@ -238,7 +238,7 @@ describe 'Filter issues', feature: true do
...
@@ -238,7 +238,7 @@ describe 'Filter issues', feature: true do
end
end
end
end
it
'
should filter
by text and author'
do
it
'
filters
by text and author'
do
fill_in
'issue_search'
,
with:
'Bug'
fill_in
'issue_search'
,
with:
'Bug'
page
.
within
'.issues-list'
do
page
.
within
'.issues-list'
do
...
@@ -269,7 +269,7 @@ describe 'Filter issues', feature: true do
...
@@ -269,7 +269,7 @@ describe 'Filter issues', feature: true do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
end
it
'
should be
able to filter and sort issues'
do
it
'
is
able to filter and sort issues'
do
click_button
'Label'
click_button
'Label'
wait_for_ajax
wait_for_ajax
page
.
within
'.labels-filter'
do
page
.
within
'.labels-filter'
do
...
...
spec/features/issues/issue_sidebar_spec.rb
View file @
519275c1
...
@@ -17,7 +17,7 @@ feature 'Issue Sidebar', feature: true do
...
@@ -17,7 +17,7 @@ feature 'Issue Sidebar', feature: true do
end
end
describe
'when clicking on edit labels'
,
js:
true
do
describe
'when clicking on edit labels'
,
js:
true
do
it
'
dropdown has a
n option to create a new label'
do
it
'
shows dropdow
n option to create a new label'
do
find
(
'.block.labels .edit-link'
).
click
find
(
'.block.labels .edit-link'
).
click
page
.
within
(
'.block.labels'
)
do
page
.
within
(
'.block.labels'
)
do
...
@@ -27,7 +27,7 @@ feature 'Issue Sidebar', feature: true do
...
@@ -27,7 +27,7 @@ feature 'Issue Sidebar', feature: true do
end
end
context
'creating a new label'
,
js:
true
do
context
'creating a new label'
,
js:
true
do
it
'option to crate a new label is present'
do
it
'
shows
option to crate a new label is present'
do
page
.
within
(
'.block.labels'
)
do
page
.
within
(
'.block.labels'
)
do
find
(
'.edit-link'
).
click
find
(
'.edit-link'
).
click
...
@@ -35,7 +35,7 @@ feature 'Issue Sidebar', feature: true do
...
@@ -35,7 +35,7 @@ feature 'Issue Sidebar', feature: true do
end
end
end
end
it
'dropdown switches to "create label" section'
do
it
'
shows
dropdown switches to "create label" section'
do
page
.
within
(
'.block.labels'
)
do
page
.
within
(
'.block.labels'
)
do
find
(
'.edit-link'
).
click
find
(
'.edit-link'
).
click
click_link
'Create new'
click_link
'Create new'
...
@@ -44,7 +44,7 @@ feature 'Issue Sidebar', feature: true do
...
@@ -44,7 +44,7 @@ feature 'Issue Sidebar', feature: true do
end
end
end
end
it
'
new label is added
'
do
it
'
adds new label
'
do
page
.
within
(
'.block.labels'
)
do
page
.
within
(
'.block.labels'
)
do
find
(
'.edit-link'
).
click
find
(
'.edit-link'
).
click
sleep
1
sleep
1
...
...
spec/features/issues/new_branch_button_spec.rb
View file @
519275c1
...
@@ -41,7 +41,7 @@ feature 'Start new branch from an issue', feature: true do
...
@@ -41,7 +41,7 @@ feature 'Start new branch from an issue', feature: true do
end
end
context
"for visiters"
do
context
"for visiters"
do
it
'
no button is shown
'
,
js:
true
do
it
'
shows no buttons
'
,
js:
true
do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
expect
(
page
).
not_to
have_css
(
'#new-branch'
)
expect
(
page
).
not_to
have_css
(
'#new-branch'
)
...
...
spec/features/issues/todo_spec.rb
View file @
519275c1
...
@@ -11,7 +11,7 @@ feature 'Manually create a todo item from issue', feature: true, js: true do
...
@@ -11,7 +11,7 @@ feature 'Manually create a todo item from issue', feature: true, js: true do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
end
it
'
should create
todo when clicking button'
do
it
'
creates
todo when clicking button'
do
page
.
within
'.issuable-sidebar'
do
page
.
within
'.issuable-sidebar'
do
click_button
'Add Todo'
click_button
'Add Todo'
expect
(
page
).
to
have_content
'Mark Done'
expect
(
page
).
to
have_content
'Mark Done'
...
@@ -28,7 +28,7 @@ feature 'Manually create a todo item from issue', feature: true, js: true do
...
@@ -28,7 +28,7 @@ feature 'Manually create a todo item from issue', feature: true, js: true do
end
end
end
end
it
'
should mark
a todo as done'
do
it
'
marks
a todo as done'
do
page
.
within
'.issuable-sidebar'
do
page
.
within
'.issuable-sidebar'
do
click_button
'Add Todo'
click_button
'Add Todo'
click_button
'Mark Done'
click_button
'Mark Done'
...
...
spec/features/issues/update_issues_spec.rb
View file @
519275c1
...
@@ -13,7 +13,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
...
@@ -13,7 +13,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
end
end
context
'status'
,
js:
true
do
context
'status'
,
js:
true
do
it
's
hould be set
to closed'
do
it
's
ets
to closed'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
find
(
'#check_all_issues'
).
click
find
(
'#check_all_issues'
).
click
...
@@ -24,7 +24,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
...
@@ -24,7 +24,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
0
)
expect
(
page
).
to
have_selector
(
'.issue'
,
count:
0
)
end
end
it
's
hould be set
to open'
do
it
's
ets
to open'
do
create_closed
create_closed
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
state:
'closed'
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
state:
'closed'
)
...
@@ -38,7 +38,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
...
@@ -38,7 +38,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
end
end
context
'assignee'
,
js:
true
do
context
'assignee'
,
js:
true
do
it
'
should update
to current user'
do
it
'
updates
to current user'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
find
(
'#check_all_issues'
).
click
find
(
'#check_all_issues'
).
click
...
@@ -52,7 +52,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
...
@@ -52,7 +52,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
end
end
end
end
it
'
should update
to unassigned'
do
it
'
updates
to unassigned'
do
create_assigned
create_assigned
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
...
@@ -68,7 +68,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
...
@@ -68,7 +68,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
context
'milestone'
,
js:
true
do
context
'milestone'
,
js:
true
do
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
it
'
should update
milestone'
do
it
'
updates
milestone'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
find
(
'#check_all_issues'
).
click
find
(
'#check_all_issues'
).
click
...
@@ -80,7 +80,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
...
@@ -80,7 +80,7 @@ feature 'Multiple issue updating from issues#index', feature: true do
expect
(
find
(
'.issue'
)).
to
have_content
milestone
.
title
expect
(
find
(
'.issue'
)).
to
have_content
milestone
.
title
end
end
it
's
hould set
to no milestone'
do
it
's
ets
to no milestone'
do
create_with_milestone
create_with_milestone
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
...
...
spec/features/issues_spec.rb
View file @
519275c1
...
@@ -26,7 +26,7 @@ describe 'Issues', feature: true do
...
@@ -26,7 +26,7 @@ describe 'Issues', feature: true do
find
(
'.js-zen-enter'
).
click
find
(
'.js-zen-enter'
).
click
end
end
it
'
should open
new issue popup'
do
it
'
opens
new issue popup'
do
expect
(
page
).
to
have_content
(
"Issue #
#{
issue
.
iid
}
"
)
expect
(
page
).
to
have_content
(
"Issue #
#{
issue
.
iid
}
"
)
end
end
...
@@ -71,7 +71,7 @@ describe 'Issues', feature: true do
...
@@ -71,7 +71,7 @@ describe 'Issues', feature: true do
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
)
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
)
end
end
it
's
hould save
with due date'
do
it
's
aves
with due date'
do
date
=
Date
.
today
.
at_beginning_of_month
date
=
Date
.
today
.
at_beginning_of_month
fill_in
'issue_title'
,
with:
'bug 345'
fill_in
'issue_title'
,
with:
'bug 345'
...
@@ -99,7 +99,7 @@ describe 'Issues', feature: true do
...
@@ -99,7 +99,7 @@ describe 'Issues', feature: true do
visit
edit_namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
edit_namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
end
it
's
hould save
with due date'
do
it
's
aves
with due date'
do
date
=
Date
.
today
.
at_beginning_of_month
date
=
Date
.
today
.
at_beginning_of_month
expect
(
find
(
'#issuable-due-date'
).
value
).
to
eq
date
.
to_s
expect
(
find
(
'#issuable-due-date'
).
value
).
to
eq
date
.
to_s
...
@@ -155,7 +155,7 @@ describe 'Issues', feature: true do
...
@@ -155,7 +155,7 @@ describe 'Issues', feature: true do
let
(
:issue
)
{
@issue
}
let
(
:issue
)
{
@issue
}
it
'
should allow
filtering by issues with no specified assignee'
do
it
'
allows
filtering by issues with no specified assignee'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
assignee_id:
IssuableFinder
::
NONE
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
assignee_id:
IssuableFinder
::
NONE
)
expect
(
page
).
to
have_content
'foobar'
expect
(
page
).
to
have_content
'foobar'
...
@@ -163,7 +163,7 @@ describe 'Issues', feature: true do
...
@@ -163,7 +163,7 @@ describe 'Issues', feature: true do
expect
(
page
).
not_to
have_content
'gitlab'
expect
(
page
).
not_to
have_content
'gitlab'
end
end
it
'
should allow
filtering by a specified assignee'
do
it
'
allows
filtering by a specified assignee'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
assignee_id:
@user
.
id
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
assignee_id:
@user
.
id
)
expect
(
page
).
not_to
have_content
'foobar'
expect
(
page
).
not_to
have_content
'foobar'
...
@@ -514,7 +514,7 @@ describe 'Issues', feature: true do
...
@@ -514,7 +514,7 @@ describe 'Issues', feature: true do
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
)
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
)
end
end
it
'
should upload
file when dragging into textarea'
do
it
'
uploads
file when dragging into textarea'
do
drop_in_dropzone
test_image_file
drop_in_dropzone
test_image_file
# Wait for the file to upload
# Wait for the file to upload
...
@@ -562,7 +562,7 @@ describe 'Issues', feature: true do
...
@@ -562,7 +562,7 @@ describe 'Issues', feature: true do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
end
it
'
should add
due date to issue'
do
it
'
adds
due date to issue'
do
page
.
within
'.due_date'
do
page
.
within
'.due_date'
do
click_link
'Edit'
click_link
'Edit'
...
@@ -574,7 +574,7 @@ describe 'Issues', feature: true do
...
@@ -574,7 +574,7 @@ describe 'Issues', feature: true do
end
end
end
end
it
'
should remove
due date from issue'
do
it
'
removes
due date from issue'
do
page
.
within
'.due_date'
do
page
.
within
'.due_date'
do
click_link
'Edit'
click_link
'Edit'
...
...
spec/features/login_spec.rb
View file @
519275c1
...
@@ -131,7 +131,7 @@ feature 'Login', feature: true do
...
@@ -131,7 +131,7 @@ feature 'Login', feature: true do
expect_any_instance_of
(
Object
).
to
receive
(
:omniauth_authorize_path
).
with
(
:user
,
"saml"
).
and_return
(
'/users/auth/saml'
)
expect_any_instance_of
(
Object
).
to
receive
(
:omniauth_authorize_path
).
with
(
:user
,
"saml"
).
and_return
(
'/users/auth/saml'
)
end
end
it
'sho
uld show
2FA prompt after OAuth login'
do
it
'sho
ws
2FA prompt after OAuth login'
do
stub_omniauth_config
(
enabled:
true
,
auto_link_saml_user:
true
,
allow_single_sign_on:
[
'saml'
],
providers:
[
saml_config
])
stub_omniauth_config
(
enabled:
true
,
auto_link_saml_user:
true
,
allow_single_sign_on:
[
'saml'
],
providers:
[
saml_config
])
user
=
create
(
:omniauth_user
,
:two_factor
,
extern_uid:
'my-uid'
,
provider:
'saml'
)
user
=
create
(
:omniauth_user
,
:two_factor
,
extern_uid:
'my-uid'
,
provider:
'saml'
)
login_via
(
'saml'
,
user
,
'my-uid'
)
login_via
(
'saml'
,
user
,
'my-uid'
)
...
...
spec/features/merge_requests/award_spec.rb
View file @
519275c1
...
@@ -11,7 +11,7 @@ feature 'Merge request awards', js: true, feature: true do
...
@@ -11,7 +11,7 @@ feature 'Merge request awards', js: true, feature: true do
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
end
it
'
should add
award to merge request'
do
it
'
adds
award to merge request'
do
first
(
'.js-emoji-btn'
).
click
first
(
'.js-emoji-btn'
).
click
expect
(
page
).
to
have_selector
(
'.js-emoji-btn.active'
)
expect
(
page
).
to
have_selector
(
'.js-emoji-btn.active'
)
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'1'
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'1'
...
@@ -20,7 +20,7 @@ feature 'Merge request awards', js: true, feature: true do
...
@@ -20,7 +20,7 @@ feature 'Merge request awards', js: true, feature: true do
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'1'
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'1'
end
end
it
'
should remove
award from merge request'
do
it
'
removes
award from merge request'
do
first
(
'.js-emoji-btn'
).
click
first
(
'.js-emoji-btn'
).
click
find
(
'.js-emoji-btn.active'
).
click
find
(
'.js-emoji-btn.active'
).
click
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'0'
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'0'
...
@@ -29,7 +29,7 @@ feature 'Merge request awards', js: true, feature: true do
...
@@ -29,7 +29,7 @@ feature 'Merge request awards', js: true, feature: true do
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'0'
expect
(
first
(
'.js-emoji-btn'
)).
to
have_content
'0'
end
end
it
'
should only have
one menu on the page'
do
it
'
has only
one menu on the page'
do
first
(
'.js-add-award'
).
click
first
(
'.js-add-award'
).
click
expect
(
page
).
to
have_selector
(
'.emoji-menu'
)
expect
(
page
).
to
have_selector
(
'.emoji-menu'
)
...
@@ -42,7 +42,7 @@ feature 'Merge request awards', js: true, feature: true do
...
@@ -42,7 +42,7 @@ feature 'Merge request awards', js: true, feature: true do
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
end
it
'
should
not see award menu button'
do
it
'
does
not see award menu button'
do
expect
(
page
).
not_to
have_selector
(
'.js-award-holder'
)
expect
(
page
).
not_to
have_selector
(
'.js-award-holder'
)
end
end
end
end
...
...
spec/features/merge_requests/edit_mr_spec.rb
View file @
519275c1
...
@@ -14,7 +14,7 @@ feature 'Edit Merge Request', feature: true do
...
@@ -14,7 +14,7 @@ feature 'Edit Merge Request', feature: true do
end
end
context
'editing a MR'
do
context
'editing a MR'
do
it
'
form should have class js-quick-submit
'
do
it
'
has class js-quick-submit in form
'
do
expect
(
page
).
to
have_selector
(
'.js-quick-submit'
)
expect
(
page
).
to
have_selector
(
'.js-quick-submit'
)
end
end
end
end
...
...
spec/features/merge_requests/filter_by_milestone_spec.rb
View file @
519275c1
...
@@ -21,7 +21,7 @@ feature 'Merge Request filtering by Milestone', feature: true do
...
@@ -21,7 +21,7 @@ feature 'Merge Request filtering by Milestone', feature: true do
end
end
context
'filters by upcoming milestone'
,
js:
true
do
context
'filters by upcoming milestone'
,
js:
true
do
it
'
should
not show issues with no expiry'
do
it
'
does
not show issues with no expiry'
do
create
(
:merge_request
,
:with_diffs
,
source_project:
project
)
create
(
:merge_request
,
:with_diffs
,
source_project:
project
)
create
(
:merge_request
,
:simple
,
source_project:
project
,
milestone:
milestone
)
create
(
:merge_request
,
:simple
,
source_project:
project
,
milestone:
milestone
)
...
@@ -31,7 +31,7 @@ feature 'Merge Request filtering by Milestone', feature: true do
...
@@ -31,7 +31,7 @@ feature 'Merge Request filtering by Milestone', feature: true do
expect
(
page
).
to
have_css
(
'.merge-request'
,
count:
0
)
expect
(
page
).
to
have_css
(
'.merge-request'
,
count:
0
)
end
end
it
'sho
uld show
issues in future'
do
it
'sho
ws
issues in future'
do
milestone
=
create
(
:milestone
,
project:
project
,
due_date:
Date
.
tomorrow
)
milestone
=
create
(
:milestone
,
project:
project
,
due_date:
Date
.
tomorrow
)
create
(
:merge_request
,
:with_diffs
,
source_project:
project
)
create
(
:merge_request
,
:with_diffs
,
source_project:
project
)
create
(
:merge_request
,
:simple
,
source_project:
project
,
milestone:
milestone
)
create
(
:merge_request
,
:simple
,
source_project:
project
,
milestone:
milestone
)
...
@@ -42,7 +42,7 @@ feature 'Merge Request filtering by Milestone', feature: true do
...
@@ -42,7 +42,7 @@ feature 'Merge Request filtering by Milestone', feature: true do
expect
(
page
).
to
have_css
(
'.merge-request'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.merge-request'
,
count:
1
)
end
end
it
'
should
not show issues in past'
do
it
'
does
not show issues in past'
do
milestone
=
create
(
:milestone
,
project:
project
,
due_date:
Date
.
yesterday
)
milestone
=
create
(
:milestone
,
project:
project
,
due_date:
Date
.
yesterday
)
create
(
:merge_request
,
:with_diffs
,
source_project:
project
)
create
(
:merge_request
,
:with_diffs
,
source_project:
project
)
create
(
:merge_request
,
:simple
,
source_project:
project
,
milestone:
milestone
)
create
(
:merge_request
,
:simple
,
source_project:
project
,
milestone:
milestone
)
...
...
spec/features/merge_requests/merge_when_build_succeeds_spec.rb
View file @
519275c1
...
@@ -73,7 +73,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
...
@@ -73,7 +73,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
end
context
'Build is not active'
do
context
'Build is not active'
do
it
"
should
not allow for enabling"
do
it
"
does
not allow for enabling"
do
visit_merge_request
(
merge_request
)
visit_merge_request
(
merge_request
)
expect
(
page
).
not_to
have_link
"Merge When Build Succeeds"
expect
(
page
).
not_to
have_link
"Merge When Build Succeeds"
end
end
...
...
spec/features/milestone_spec.rb
View file @
519275c1
...
@@ -13,7 +13,7 @@ feature 'Milestone', feature: true do
...
@@ -13,7 +13,7 @@ feature 'Milestone', feature: true do
end
end
feature
'Create a milestone'
do
feature
'Create a milestone'
do
scenario
'sho
uld show
an informative message for a new issue'
do
scenario
'sho
ws
an informative message for a new issue'
do
visit
new_namespace_project_milestone_path
(
project
.
namespace
,
project
)
visit
new_namespace_project_milestone_path
(
project
.
namespace
,
project
)
page
.
within
'.milestone-form'
do
page
.
within
'.milestone-form'
do
fill_in
"milestone_title"
,
with:
'8.7'
fill_in
"milestone_title"
,
with:
'8.7'
...
@@ -25,7 +25,7 @@ feature 'Milestone', feature: true do
...
@@ -25,7 +25,7 @@ feature 'Milestone', feature: true do
end
end
feature
'Open a milestone with closed issues'
do
feature
'Open a milestone with closed issues'
do
scenario
'sho
uld show
an informative message'
do
scenario
'sho
ws
an informative message'
do
create
(
:issue
,
title:
"Bugfix1"
,
project:
project
,
milestone:
milestone
,
state:
"closed"
)
create
(
:issue
,
title:
"Bugfix1"
,
project:
project
,
milestone:
milestone
,
state:
"closed"
)
visit
namespace_project_milestone_path
(
project
.
namespace
,
project
,
milestone
)
visit
namespace_project_milestone_path
(
project
.
namespace
,
project
,
milestone
)
...
...
spec/features/notes_on_merge_requests_spec.rb
View file @
519275c1
...
@@ -23,7 +23,7 @@ describe 'Comments', feature: true do
...
@@ -23,7 +23,7 @@ describe 'Comments', feature: true do
subject
{
page
}
subject
{
page
}
describe
'the note form'
do
describe
'the note form'
do
it
'
should be
valid'
do
it
'
is
valid'
do
is_expected
.
to
have_css
(
'.js-main-target-form'
,
visible:
true
,
count:
1
)
is_expected
.
to
have_css
(
'.js-main-target-form'
,
visible:
true
,
count:
1
)
expect
(
find
(
'.js-main-target-form input[type=submit]'
).
value
).
expect
(
find
(
'.js-main-target-form input[type=submit]'
).
value
).
to
eq
(
'Comment'
)
to
eq
(
'Comment'
)
...
@@ -39,7 +39,7 @@ describe 'Comments', feature: true do
...
@@ -39,7 +39,7 @@ describe 'Comments', feature: true do
end
end
end
end
it
'
should have
enable submit button and preview button'
do
it
'
has
enable submit button and preview button'
do
page
.
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
expect
(
page
).
not_to
have_css
(
'.js-comment-button[disabled]'
)
expect
(
page
).
not_to
have_css
(
'.js-comment-button[disabled]'
)
expect
(
page
).
to
have_css
(
'.js-md-preview-button'
,
visible:
true
)
expect
(
page
).
to
have_css
(
'.js-md-preview-button'
,
visible:
true
)
...
@@ -57,7 +57,7 @@ describe 'Comments', feature: true do
...
@@ -57,7 +57,7 @@ describe 'Comments', feature: true do
end
end
end
end
it
'
should be
added and form reset'
do
it
'
is
added and form reset'
do
is_expected
.
to
have_content
(
'This is awsome!'
)
is_expected
.
to
have_content
(
'This is awsome!'
)
page
.
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
expect
(
page
).
to
have_no_field
(
'note[note]'
,
with:
'This is awesome!'
)
expect
(
page
).
to
have_no_field
(
'note[note]'
,
with:
'This is awesome!'
)
...
@@ -70,7 +70,7 @@ describe 'Comments', feature: true do
...
@@ -70,7 +70,7 @@ describe 'Comments', feature: true do
end
end
describe
'when editing a note'
,
js:
true
do
describe
'when editing a note'
,
js:
true
do
it
'
should contain
the hidden edit form'
do
it
'
contains
the hidden edit form'
do
page
.
within
(
"#note_
#{
note
.
id
}
"
)
do
page
.
within
(
"#note_
#{
note
.
id
}
"
)
do
is_expected
.
to
have_css
(
'.note-edit-form'
,
visible:
false
)
is_expected
.
to
have_css
(
'.note-edit-form'
,
visible:
false
)
end
end
...
@@ -82,7 +82,7 @@ describe 'Comments', feature: true do
...
@@ -82,7 +82,7 @@ describe 'Comments', feature: true do
find
(
".js-note-edit"
).
click
find
(
".js-note-edit"
).
click
end
end
it
'sho
uld show
the note edit form and hide the note body'
do
it
'sho
ws
the note edit form and hide the note body'
do
page
.
within
(
"#note_
#{
note
.
id
}
"
)
do
page
.
within
(
"#note_
#{
note
.
id
}
"
)
do
expect
(
find
(
'.current-note-edit-form'
,
visible:
true
)).
to
be_visible
expect
(
find
(
'.current-note-edit-form'
,
visible:
true
)).
to
be_visible
expect
(
find
(
'.note-edit-form'
,
visible:
true
)).
to
be_visible
expect
(
find
(
'.note-edit-form'
,
visible:
true
)).
to
be_visible
...
@@ -234,7 +234,7 @@ describe 'Comments', feature: true do
...
@@ -234,7 +234,7 @@ describe 'Comments', feature: true do
end
end
end
end
it
'
should be added
as discussion'
do
it
'
adds
as discussion'
do
is_expected
.
to
have_content
(
'Another comment on line 10'
)
is_expected
.
to
have_content
(
'Another comment on line 10'
)
is_expected
.
to
have_css
(
'.notes_holder'
)
is_expected
.
to
have_css
(
'.notes_holder'
)
is_expected
.
to
have_css
(
'.notes_holder .note'
,
count:
1
)
is_expected
.
to
have_css
(
'.notes_holder .note'
,
count:
1
)
...
...
spec/features/participants_autocomplete_spec.rb
View file @
519275c1
...
@@ -12,17 +12,17 @@ feature 'Member autocomplete', feature: true do
...
@@ -12,17 +12,17 @@ feature 'Member autocomplete', feature: true do
end
end
shared_examples
"open suggestions"
do
shared_examples
"open suggestions"
do
it
'
suggestions are displayed
'
do
it
'
displays suggestions
'
do
expect
(
page
).
to
have_selector
(
'.atwho-view'
,
visible:
true
)
expect
(
page
).
to
have_selector
(
'.atwho-view'
,
visible:
true
)
end
end
it
'
author is suggested
'
do
it
'
suggests author
'
do
page
.
within
(
'.atwho-view'
,
visible:
true
)
do
page
.
within
(
'.atwho-view'
,
visible:
true
)
do
expect
(
page
).
to
have_content
(
author
.
username
)
expect
(
page
).
to
have_content
(
author
.
username
)
end
end
end
end
it
'
participant is suggested
'
do
it
'
suggests participant
'
do
page
.
within
(
'.atwho-view'
,
visible:
true
)
do
page
.
within
(
'.atwho-view'
,
visible:
true
)
do
expect
(
page
).
to
have_content
(
participant
.
username
)
expect
(
page
).
to
have_content
(
participant
.
username
)
end
end
...
...
spec/features/pipelines_spec.rb
View file @
519275c1
...
@@ -82,11 +82,11 @@ describe "Pipelines" do
...
@@ -82,11 +82,11 @@ describe "Pipelines" do
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
it
'
not be
cancelable'
do
it
'
is not
cancelable'
do
expect
(
page
).
not_to
have_link
(
'Cancel'
)
expect
(
page
).
not_to
have_link
(
'Cancel'
)
end
end
it
'
pipeline is
running'
do
it
'
has pipeline
running'
do
expect
(
page
).
to
have_selector
(
'.ci-running'
)
expect
(
page
).
to
have_selector
(
'.ci-running'
)
end
end
end
end
...
@@ -96,11 +96,11 @@ describe "Pipelines" do
...
@@ -96,11 +96,11 @@ describe "Pipelines" do
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
it
'
not be
retryable'
do
it
'
is not
retryable'
do
expect
(
page
).
not_to
have_link
(
'Retry'
)
expect
(
page
).
not_to
have_link
(
'Retry'
)
end
end
it
'
pipeline is failed
'
do
it
'
has failed pipeline
'
do
expect
(
page
).
to
have_selector
(
'.ci-failed'
)
expect
(
page
).
to
have_selector
(
'.ci-failed'
)
end
end
end
end
...
@@ -147,7 +147,7 @@ describe "Pipelines" do
...
@@ -147,7 +147,7 @@ describe "Pipelines" do
before
{
visit
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
}
before
{
visit
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
}
it
'show
ing
a list of builds'
do
it
'show
s
a list of builds'
do
expect
(
page
).
to
have_content
(
'Test'
)
expect
(
page
).
to
have_content
(
'Test'
)
expect
(
page
).
to
have_content
(
@success
.
id
)
expect
(
page
).
to
have_content
(
@success
.
id
)
expect
(
page
).
to
have_content
(
'Deploy'
)
expect
(
page
).
to
have_content
(
'Deploy'
)
...
...
spec/features/profile_spec.rb
View file @
519275c1
...
@@ -15,7 +15,7 @@ describe 'Profile account page', feature: true do
...
@@ -15,7 +15,7 @@ describe 'Profile account page', feature: true do
it
{
expect
(
page
).
to
have_content
(
'Remove account'
)
}
it
{
expect
(
page
).
to
have_content
(
'Remove account'
)
}
it
'
should delete
the account'
do
it
'
deletes
the account'
do
expect
{
click_link
'Delete account'
}.
to
change
{
User
.
count
}.
by
(
-
1
)
expect
{
click_link
'Delete account'
}.
to
change
{
User
.
count
}.
by
(
-
1
)
expect
(
current_path
).
to
eq
(
new_user_session_path
)
expect
(
current_path
).
to
eq
(
new_user_session_path
)
end
end
...
@@ -27,7 +27,7 @@ describe 'Profile account page', feature: true do
...
@@ -27,7 +27,7 @@ describe 'Profile account page', feature: true do
visit
profile_account_path
visit
profile_account_path
end
end
it
'
should
not have option to remove account'
do
it
'
does
not have option to remove account'
do
expect
(
page
).
not_to
have_content
(
'Remove account'
)
expect
(
page
).
not_to
have_content
(
'Remove account'
)
expect
(
current_path
).
to
eq
(
profile_account_path
)
expect
(
current_path
).
to
eq
(
profile_account_path
)
end
end
...
...
spec/features/projects/labels/update_prioritization_spec.rb
View file @
519275c1
...
@@ -87,7 +87,7 @@ feature 'Prioritize labels', feature: true do
...
@@ -87,7 +87,7 @@ feature 'Prioritize labels', feature: true do
end
end
context
'as a guest'
do
context
'as a guest'
do
it
'
can
not prioritize labels'
do
it
'
does
not prioritize labels'
do
user
=
create
(
:user
)
user
=
create
(
:user
)
guest
=
create
(
:user
)
guest
=
create
(
:user
)
project
=
create
(
:project
,
name:
'test'
,
namespace:
user
.
namespace
)
project
=
create
(
:project
,
name:
'test'
,
namespace:
user
.
namespace
)
...
@@ -102,7 +102,7 @@ feature 'Prioritize labels', feature: true do
...
@@ -102,7 +102,7 @@ feature 'Prioritize labels', feature: true do
end
end
context
'as a non signed in user'
do
context
'as a non signed in user'
do
it
'
can
not prioritize labels'
do
it
'
does
not prioritize labels'
do
user
=
create
(
:user
)
user
=
create
(
:user
)
project
=
create
(
:project
,
name:
'test'
,
namespace:
user
.
namespace
)
project
=
create
(
:project
,
name:
'test'
,
namespace:
user
.
namespace
)
...
...
spec/features/projects_spec.rb
View file @
519275c1
...
@@ -44,7 +44,7 @@ feature 'Project', feature: true do
...
@@ -44,7 +44,7 @@ feature 'Project', feature: true do
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
end
end
it
'
should remove
fork'
do
it
'
removes
fork'
do
expect
(
page
).
to
have_content
'Remove fork relationship'
expect
(
page
).
to
have_content
'Remove fork relationship'
remove_with_confirm
(
'Remove fork relationship'
,
project
.
path
)
remove_with_confirm
(
'Remove fork relationship'
,
project
.
path
)
...
@@ -65,7 +65,7 @@ feature 'Project', feature: true do
...
@@ -65,7 +65,7 @@ feature 'Project', feature: true do
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
end
end
it
'
should remove
project'
do
it
'
removes
project'
do
expect
{
remove_with_confirm
(
'Remove project'
,
project
.
path
)
}.
to
change
{
Project
.
count
}.
by
(
-
1
)
expect
{
remove_with_confirm
(
'Remove project'
,
project
.
path
)
}.
to
change
{
Project
.
count
}.
by
(
-
1
)
end
end
end
end
...
@@ -82,7 +82,7 @@ feature 'Project', feature: true do
...
@@ -82,7 +82,7 @@ feature 'Project', feature: true do
visit
namespace_project_path
(
project
.
namespace
,
project
)
visit
namespace_project_path
(
project
.
namespace
,
project
)
end
end
it
'click
toggle and show
dropdown'
,
js:
true
do
it
'click
s toggle and shows
dropdown'
,
js:
true
do
find
(
'.js-projects-dropdown-toggle'
).
click
find
(
'.js-projects-dropdown-toggle'
).
click
expect
(
page
).
to
have_css
(
'.dropdown-menu-projects .dropdown-content li'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.dropdown-menu-projects .dropdown-content li'
,
count:
1
)
end
end
...
@@ -102,7 +102,7 @@ feature 'Project', feature: true do
...
@@ -102,7 +102,7 @@ feature 'Project', feature: true do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
end
it
'click
toggle and show
dropdown'
do
it
'click
s toggle and shows
dropdown'
do
find
(
'.js-projects-dropdown-toggle'
).
click
find
(
'.js-projects-dropdown-toggle'
).
click
expect
(
page
).
to
have_css
(
'.dropdown-menu-projects .dropdown-content li'
,
count:
2
)
expect
(
page
).
to
have_css
(
'.dropdown-menu-projects .dropdown-content li'
,
count:
2
)
...
...
spec/features/search_spec.rb
View file @
519275c1
...
@@ -12,7 +12,7 @@ describe "Search", feature: true do
...
@@ -12,7 +12,7 @@ describe "Search", feature: true do
visit
search_path
visit
search_path
end
end
it
'
top right search form is not present
'
do
it
'
does not show top right search form
'
do
expect
(
page
).
not_to
have_selector
(
'.search'
)
expect
(
page
).
not_to
have_selector
(
'.search'
)
end
end
...
@@ -76,16 +76,16 @@ describe "Search", feature: true do
...
@@ -76,16 +76,16 @@ describe "Search", feature: true do
visit
namespace_project_path
(
project
.
namespace
,
project
)
visit
namespace_project_path
(
project
.
namespace
,
project
)
end
end
it
'
top right search form is present
'
do
it
'
shows top right search form
'
do
expect
(
page
).
to
have_selector
(
'#search'
)
expect
(
page
).
to
have_selector
(
'#search'
)
end
end
it
'
top right search form contains location badge
'
do
it
'
contains location badge in top right search form
'
do
expect
(
page
).
to
have_selector
(
'.has-location-badge'
)
expect
(
page
).
to
have_selector
(
'.has-location-badge'
)
end
end
context
'clicking the search field'
,
js:
true
do
context
'clicking the search field'
,
js:
true
do
it
'sho
uld show
category search dropdown'
do
it
'sho
ws
category search dropdown'
do
page
.
find
(
'#search'
).
click
page
.
find
(
'#search'
).
click
expect
(
page
).
to
have_selector
(
'.dropdown-header'
,
text:
/
#{
project
.
name
}
/i
)
expect
(
page
).
to
have_selector
(
'.dropdown-header'
,
text:
/
#{
project
.
name
}
/i
)
...
@@ -97,7 +97,7 @@ describe "Search", feature: true do
...
@@ -97,7 +97,7 @@ describe "Search", feature: true do
page
.
find
(
'#search'
).
click
page
.
find
(
'#search'
).
click
end
end
it
'
should take
user to her issues page when issues assigned is clicked'
do
it
'
takes
user to her issues page when issues assigned is clicked'
do
find
(
'.dropdown-menu'
).
click_link
'Issues assigned to me'
find
(
'.dropdown-menu'
).
click_link
'Issues assigned to me'
sleep
2
sleep
2
...
@@ -105,7 +105,7 @@ describe "Search", feature: true do
...
@@ -105,7 +105,7 @@ describe "Search", feature: true do
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
end
end
it
'
should take
user to her issues page when issues authored is clicked'
do
it
'
takes
user to her issues page when issues authored is clicked'
do
find
(
'.dropdown-menu'
).
click_link
"Issues I've created"
find
(
'.dropdown-menu'
).
click_link
"Issues I've created"
sleep
2
sleep
2
...
@@ -113,7 +113,7 @@ describe "Search", feature: true do
...
@@ -113,7 +113,7 @@ describe "Search", feature: true do
expect
(
find
(
'.js-author-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-author-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
end
end
it
'
should take
user to her MR page when MR assigned is clicked'
do
it
'
takes
user to her MR page when MR assigned is clicked'
do
find
(
'.dropdown-menu'
).
click_link
'Merge requests assigned to me'
find
(
'.dropdown-menu'
).
click_link
'Merge requests assigned to me'
sleep
2
sleep
2
...
@@ -121,7 +121,7 @@ describe "Search", feature: true do
...
@@ -121,7 +121,7 @@ describe "Search", feature: true do
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-assignee-search .dropdown-toggle-text'
)).
to
have_content
(
user
.
name
)
end
end
it
'
should take
user to her MR page when MR authored is clicked'
do
it
'
takes
user to her MR page when MR authored is clicked'
do
find
(
'.dropdown-menu'
).
click_link
"Merge requests I've created"
find
(
'.dropdown-menu'
).
click_link
"Merge requests I've created"
sleep
2
sleep
2
...
@@ -137,7 +137,7 @@ describe "Search", feature: true do
...
@@ -137,7 +137,7 @@ describe "Search", feature: true do
end
end
end
end
it
'
should
not display the category search dropdown'
do
it
'
does
not display the category search dropdown'
do
expect
(
page
).
not_to
have_selector
(
'.dropdown-header'
,
text:
/
#{
project
.
name
}
/i
)
expect
(
page
).
not_to
have_selector
(
'.dropdown-header'
,
text:
/
#{
project
.
name
}
/i
)
end
end
end
end
...
...
spec/features/todos/todos_spec.rb
View file @
519275c1
...
@@ -24,7 +24,7 @@ describe 'Dashboard Todos', feature: true do
...
@@ -24,7 +24,7 @@ describe 'Dashboard Todos', feature: true do
visit
dashboard_todos_path
visit
dashboard_todos_path
end
end
it
'
todo is
present'
do
it
'
has todo
present'
do
expect
(
page
).
to
have_selector
(
'.todos-list .todo'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.todos-list .todo'
,
count:
1
)
end
end
...
...
spec/features/variables_spec.rb
View file @
519275c1
...
@@ -13,13 +13,13 @@ describe 'Project variables', js: true do
...
@@ -13,13 +13,13 @@ describe 'Project variables', js: true do
visit
namespace_project_variables_path
(
project
.
namespace
,
project
)
visit
namespace_project_variables_path
(
project
.
namespace
,
project
)
end
end
it
'sho
uld show
list of variables'
do
it
'sho
ws
list of variables'
do
page
.
within
(
'.variables-table'
)
do
page
.
within
(
'.variables-table'
)
do
expect
(
page
).
to
have_content
(
variable
.
key
)
expect
(
page
).
to
have_content
(
variable
.
key
)
end
end
end
end
it
'
should add
new variable'
do
it
'
adds
new variable'
do
fill_in
(
'variable_key'
,
with:
'key'
)
fill_in
(
'variable_key'
,
with:
'key'
)
fill_in
(
'variable_value'
,
with:
'key value'
)
fill_in
(
'variable_value'
,
with:
'key value'
)
click_button
(
'Add new variable'
)
click_button
(
'Add new variable'
)
...
@@ -29,7 +29,7 @@ describe 'Project variables', js: true do
...
@@ -29,7 +29,7 @@ describe 'Project variables', js: true do
end
end
end
end
it
'
should delete
variable'
do
it
'
deletes
variable'
do
page
.
within
(
'.variables-table'
)
do
page
.
within
(
'.variables-table'
)
do
find
(
'.btn-variable-delete'
).
click
find
(
'.btn-variable-delete'
).
click
end
end
...
@@ -37,7 +37,7 @@ describe 'Project variables', js: true do
...
@@ -37,7 +37,7 @@ describe 'Project variables', js: true do
expect
(
page
).
not_to
have_selector
(
'variables-table'
)
expect
(
page
).
not_to
have_selector
(
'variables-table'
)
end
end
it
'
should edit
variable'
do
it
'
edits
variable'
do
page
.
within
(
'.variables-table'
)
do
page
.
within
(
'.variables-table'
)
do
find
(
'.btn-variable-edit'
).
click
find
(
'.btn-variable-edit'
).
click
end
end
...
...
spec/finders/merge_requests_finder_spec.rb
View file @
519275c1
...
@@ -18,13 +18,13 @@ describe MergeRequestsFinder do
...
@@ -18,13 +18,13 @@ describe MergeRequestsFinder do
end
end
describe
"#execute"
do
describe
"#execute"
do
it
'
should filter
by scope'
do
it
'
filters
by scope'
do
params
=
{
scope:
'authored'
,
state:
'opened'
}
params
=
{
scope:
'authored'
,
state:
'opened'
}
merge_requests
=
MergeRequestsFinder
.
new
(
user
,
params
).
execute
merge_requests
=
MergeRequestsFinder
.
new
(
user
,
params
).
execute
expect
(
merge_requests
.
size
).
to
eq
(
2
)
expect
(
merge_requests
.
size
).
to
eq
(
2
)
end
end
it
'
should filter
by project'
do
it
'
filters
by project'
do
params
=
{
project_id:
project1
.
id
,
scope:
'authored'
,
state:
'opened'
}
params
=
{
project_id:
project1
.
id
,
scope:
'authored'
,
state:
'opened'
}
merge_requests
=
MergeRequestsFinder
.
new
(
user
,
params
).
execute
merge_requests
=
MergeRequestsFinder
.
new
(
user
,
params
).
execute
expect
(
merge_requests
.
size
).
to
eq
(
1
)
expect
(
merge_requests
.
size
).
to
eq
(
1
)
...
...
spec/finders/notes_finder_spec.rb
View file @
519275c1
...
@@ -19,12 +19,12 @@ describe NotesFinder do
...
@@ -19,12 +19,12 @@ describe NotesFinder do
note2
note2
end
end
it
'
should find
all notes'
do
it
'
finds
all notes'
do
notes
=
NotesFinder
.
new
.
execute
(
project
,
user
,
params
)
notes
=
NotesFinder
.
new
.
execute
(
project
,
user
,
params
)
expect
(
notes
.
size
).
to
eq
(
2
)
expect
(
notes
.
size
).
to
eq
(
2
)
end
end
it
'
should raise
an exception for an invalid target_type'
do
it
'
raises
an exception for an invalid target_type'
do
params
.
merge!
(
target_type:
'invalid'
)
params
.
merge!
(
target_type:
'invalid'
)
expect
{
NotesFinder
.
new
.
execute
(
project
,
user
,
params
)
}.
to
raise_error
(
'invalid target_type'
)
expect
{
NotesFinder
.
new
.
execute
(
project
,
user
,
params
)
}.
to
raise_error
(
'invalid target_type'
)
end
end
...
...
spec/helpers/application_helper_spec.rb
View file @
519275c1
...
@@ -54,7 +54,7 @@ describe ApplicationHelper do
...
@@ -54,7 +54,7 @@ describe ApplicationHelper do
describe
'project_icon'
do
describe
'project_icon'
do
let
(
:avatar_file_path
)
{
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
}
let
(
:avatar_file_path
)
{
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
}
it
'
should return
an url for the avatar'
do
it
'
returns
an url for the avatar'
do
project
=
create
(
:project
,
avatar:
File
.
open
(
avatar_file_path
))
project
=
create
(
:project
,
avatar:
File
.
open
(
avatar_file_path
))
avatar_url
=
"http://localhost/uploads/project/avatar/
#{
project
.
id
}
/banana_sample.gif"
avatar_url
=
"http://localhost/uploads/project/avatar/
#{
project
.
id
}
/banana_sample.gif"
...
@@ -62,7 +62,7 @@ describe ApplicationHelper do
...
@@ -62,7 +62,7 @@ describe ApplicationHelper do
to
eq
"<img src=
\"
#{
avatar_url
}
\"
alt=
\"
Banana sample
\"
/>"
to
eq
"<img src=
\"
#{
avatar_url
}
\"
alt=
\"
Banana sample
\"
/>"
end
end
it
'
should give
uploaded icon when present'
do
it
'
gives
uploaded icon when present'
do
project
=
create
(
:project
)
project
=
create
(
:project
)
allow_any_instance_of
(
Project
).
to
receive
(
:avatar_in_git
).
and_return
(
true
)
allow_any_instance_of
(
Project
).
to
receive
(
:avatar_in_git
).
and_return
(
true
)
...
@@ -76,14 +76,14 @@ describe ApplicationHelper do
...
@@ -76,14 +76,14 @@ describe ApplicationHelper do
describe
'avatar_icon'
do
describe
'avatar_icon'
do
let
(
:avatar_file_path
)
{
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
}
let
(
:avatar_file_path
)
{
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
}
it
'
should return
an url for the avatar'
do
it
'
returns
an url for the avatar'
do
user
=
create
(
:user
,
avatar:
File
.
open
(
avatar_file_path
))
user
=
create
(
:user
,
avatar:
File
.
open
(
avatar_file_path
))
expect
(
helper
.
avatar_icon
(
user
.
email
).
to_s
).
expect
(
helper
.
avatar_icon
(
user
.
email
).
to_s
).
to
match
(
"/uploads/user/avatar/
#{
user
.
id
}
/banana_sample.gif"
)
to
match
(
"/uploads/user/avatar/
#{
user
.
id
}
/banana_sample.gif"
)
end
end
it
'
should return
an url for the avatar with relative url'
do
it
'
returns
an url for the avatar with relative url'
do
stub_config_setting
(
relative_url_root:
'/gitlab'
)
stub_config_setting
(
relative_url_root:
'/gitlab'
)
# Must be stubbed after the stub above, and separately
# Must be stubbed after the stub above, and separately
stub_config_setting
(
url:
Settings
.
send
(
:build_gitlab_url
))
stub_config_setting
(
url:
Settings
.
send
(
:build_gitlab_url
))
...
@@ -94,14 +94,14 @@ describe ApplicationHelper do
...
@@ -94,14 +94,14 @@ describe ApplicationHelper do
to
match
(
"/gitlab/uploads/user/avatar/
#{
user
.
id
}
/banana_sample.gif"
)
to
match
(
"/gitlab/uploads/user/avatar/
#{
user
.
id
}
/banana_sample.gif"
)
end
end
it
'
should call
gravatar_icon when no User exists with the given email'
do
it
'
calls
gravatar_icon when no User exists with the given email'
do
expect
(
helper
).
to
receive
(
:gravatar_icon
).
with
(
'foo@example.com'
,
20
,
2
)
expect
(
helper
).
to
receive
(
:gravatar_icon
).
with
(
'foo@example.com'
,
20
,
2
)
helper
.
avatar_icon
(
'foo@example.com'
,
20
,
2
)
helper
.
avatar_icon
(
'foo@example.com'
,
20
,
2
)
end
end
describe
'using a User'
do
describe
'using a User'
do
it
'
should return
an URL for the avatar'
do
it
'
returns
an URL for the avatar'
do
user
=
create
(
:user
,
avatar:
File
.
open
(
avatar_file_path
))
user
=
create
(
:user
,
avatar:
File
.
open
(
avatar_file_path
))
expect
(
helper
.
avatar_icon
(
user
).
to_s
).
expect
(
helper
.
avatar_icon
(
user
).
to_s
).
...
@@ -146,7 +146,7 @@ describe ApplicationHelper do
...
@@ -146,7 +146,7 @@ describe ApplicationHelper do
to
match
(
'https://secure.gravatar.com'
)
to
match
(
'https://secure.gravatar.com'
)
end
end
it
'
should return
custom gravatar path when gravatar_url is set'
do
it
'
returns
custom gravatar path when gravatar_url is set'
do
stub_gravatar_setting
(
plain_url:
'http://example.local/?s=%{size}&hash=%{hash}'
)
stub_gravatar_setting
(
plain_url:
'http://example.local/?s=%{size}&hash=%{hash}'
)
expect
(
gravatar_icon
(
user_email
,
20
)).
expect
(
gravatar_icon
(
user_email
,
20
)).
...
@@ -266,19 +266,19 @@ describe ApplicationHelper do
...
@@ -266,19 +266,19 @@ describe ApplicationHelper do
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
end
end
it
'
should preserve
encoding'
do
it
'
preserves
encoding'
do
expect
(
content
.
encoding
.
name
).
to
eq
(
'UTF-8'
)
expect
(
content
.
encoding
.
name
).
to
eq
(
'UTF-8'
)
expect
(
helper
.
render_markup
(
'foo.rst'
,
content
).
encoding
.
name
).
to
eq
(
'UTF-8'
)
expect
(
helper
.
render_markup
(
'foo.rst'
,
content
).
encoding
.
name
).
to
eq
(
'UTF-8'
)
end
end
it
"
should delegate
to #markdown when file name corresponds to Markdown"
do
it
"
delegates
to #markdown when file name corresponds to Markdown"
do
expect
(
helper
).
to
receive
(
:gitlab_markdown?
).
with
(
'foo.md'
).
and_return
(
true
)
expect
(
helper
).
to
receive
(
:gitlab_markdown?
).
with
(
'foo.md'
).
and_return
(
true
)
expect
(
helper
).
to
receive
(
:markdown
).
and_return
(
'NOEL'
)
expect
(
helper
).
to
receive
(
:markdown
).
and_return
(
'NOEL'
)
expect
(
helper
.
render_markup
(
'foo.md'
,
content
)).
to
eq
(
'NOEL'
)
expect
(
helper
.
render_markup
(
'foo.md'
,
content
)).
to
eq
(
'NOEL'
)
end
end
it
"
should delegate
to #asciidoc when file name corresponds to AsciiDoc"
do
it
"
delegates
to #asciidoc when file name corresponds to AsciiDoc"
do
expect
(
helper
).
to
receive
(
:asciidoc?
).
with
(
'foo.adoc'
).
and_return
(
true
)
expect
(
helper
).
to
receive
(
:asciidoc?
).
with
(
'foo.adoc'
).
and_return
(
true
)
expect
(
helper
).
to
receive
(
:asciidoc
).
and_return
(
'NOEL'
)
expect
(
helper
).
to
receive
(
:asciidoc
).
and_return
(
'NOEL'
)
...
...
spec/helpers/blob_helper_spec.rb
View file @
519275c1
...
@@ -17,19 +17,19 @@ describe BlobHelper do
...
@@ -17,19 +17,19 @@ describe BlobHelper do
end
end
describe
'#highlight'
do
describe
'#highlight'
do
it
'
should return
plaintext for unknown lexer context'
do
it
'
returns
plaintext for unknown lexer context'
do
result
=
helper
.
highlight
(
blob_name
,
no_context_content
)
result
=
helper
.
highlight
(
blob_name
,
no_context_content
)
expect
(
result
).
to
eq
(
%[<pre class="code highlight"><code><span id="LC1" class="line">:type "assem"))</span></code></pre>]
)
expect
(
result
).
to
eq
(
%[<pre class="code highlight"><code><span id="LC1" class="line">:type "assem"))</span></code></pre>]
)
end
end
it
'
should highlight
single block'
do
it
'
highlights
single block'
do
expected
=
%Q[<pre class="code highlight"><code><span id="LC1" class="line"><span class="p">(</span><span class="nb">make-pathname</span> <span class="ss">:defaults</span> <span class="nv">name</span></span>
expected
=
%Q[<pre class="code highlight"><code><span id="LC1" class="line"><span class="p">(</span><span class="nb">make-pathname</span> <span class="ss">:defaults</span> <span class="nv">name</span></span>
<span id="LC2" class="line"><span class="ss">:type</span> <span class="s">"assem"</span><span class="p">))</span></span></code></pre>]
<span id="LC2" class="line"><span class="ss">:type</span> <span class="s">"assem"</span><span class="p">))</span></span></code></pre>]
expect
(
helper
.
highlight
(
blob_name
,
blob_content
)).
to
eq
(
expected
)
expect
(
helper
.
highlight
(
blob_name
,
blob_content
)).
to
eq
(
expected
)
end
end
it
'
should highlight
multi-line comments'
do
it
'
highlights
multi-line comments'
do
result
=
helper
.
highlight
(
blob_name
,
multiline_content
)
result
=
helper
.
highlight
(
blob_name
,
multiline_content
)
html
=
Nokogiri
::
HTML
(
result
)
html
=
Nokogiri
::
HTML
(
result
)
lines
=
html
.
search
(
'.s'
)
lines
=
html
.
search
(
'.s'
)
...
@@ -49,7 +49,7 @@ describe BlobHelper do
...
@@ -49,7 +49,7 @@ describe BlobHelper do
<span id="LC4" class="line"> ddd</span></code></pre>)
<span id="LC4" class="line"> ddd</span></code></pre>)
end
end
it
'
should highlight
each line properly'
do
it
'
highlights
each line properly'
do
result
=
helper
.
highlight
(
blob_name
,
blob_content
)
result
=
helper
.
highlight
(
blob_name
,
blob_content
)
expect
(
result
).
to
eq
(
expected
)
expect
(
result
).
to
eq
(
expected
)
end
end
...
@@ -62,7 +62,7 @@ describe BlobHelper do
...
@@ -62,7 +62,7 @@ describe BlobHelper do
let
(
:expected_svg_path
)
{
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'sanitized.svg'
)
}
let
(
:expected_svg_path
)
{
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'sanitized.svg'
)
}
let
(
:expected
)
{
open
(
expected_svg_path
).
read
}
let
(
:expected
)
{
open
(
expected_svg_path
).
read
}
it
'
should retain
essential elements'
do
it
'
retains
essential elements'
do
blob
=
OpenStruct
.
new
(
data:
data
)
blob
=
OpenStruct
.
new
(
data:
data
)
expect
(
sanitize_svg
(
blob
).
data
).
to
eq
(
expected
)
expect
(
sanitize_svg
(
blob
).
data
).
to
eq
(
expected
)
end
end
...
...
spec/helpers/diff_helper_spec.rb
View file @
519275c1
...
@@ -32,16 +32,16 @@ describe DiffHelper do
...
@@ -32,16 +32,16 @@ describe DiffHelper do
end
end
describe
'diff_options'
do
describe
'diff_options'
do
it
'
should return
no collapse false'
do
it
'
returns
no collapse false'
do
expect
(
diff_options
).
to
include
(
no_collapse:
false
)
expect
(
diff_options
).
to
include
(
no_collapse:
false
)
end
end
it
'
should return
no collapse true if expand_all_diffs'
do
it
'
returns
no collapse true if expand_all_diffs'
do
allow
(
controller
).
to
receive
(
:params
)
{
{
expand_all_diffs:
true
}
}
allow
(
controller
).
to
receive
(
:params
)
{
{
expand_all_diffs:
true
}
}
expect
(
diff_options
).
to
include
(
no_collapse:
true
)
expect
(
diff_options
).
to
include
(
no_collapse:
true
)
end
end
it
'
should return
no collapse true if action name diff_for_path'
do
it
'
returns
no collapse true if action name diff_for_path'
do
allow
(
controller
).
to
receive
(
:action_name
)
{
'diff_for_path'
}
allow
(
controller
).
to
receive
(
:action_name
)
{
'diff_for_path'
}
expect
(
diff_options
).
to
include
(
no_collapse:
true
)
expect
(
diff_options
).
to
include
(
no_collapse:
true
)
end
end
...
@@ -60,11 +60,11 @@ describe DiffHelper do
...
@@ -60,11 +60,11 @@ describe DiffHelper do
end
end
describe
'#diff_line_content'
do
describe
'#diff_line_content'
do
it
'
should return
non breaking space when line is empty'
do
it
'
returns
non breaking space when line is empty'
do
expect
(
diff_line_content
(
nil
)).
to
eq
(
' '
)
expect
(
diff_line_content
(
nil
)).
to
eq
(
' '
)
end
end
it
'
should return
the line itself'
do
it
'
returns
the line itself'
do
expect
(
diff_line_content
(
diff_file
.
diff_lines
.
first
.
text
)).
expect
(
diff_line_content
(
diff_file
.
diff_lines
.
first
.
text
)).
to
eq
(
'@@ -6,12 +6,18 @@ module Popen'
)
to
eq
(
'@@ -6,12 +6,18 @@ module Popen'
)
expect
(
diff_line_content
(
diff_file
.
diff_lines
.
first
.
type
)).
to
eq
(
'match'
)
expect
(
diff_line_content
(
diff_file
.
diff_lines
.
first
.
type
)).
to
eq
(
'match'
)
...
...
spec/helpers/emails_helper_spec.rb
View file @
519275c1
...
@@ -8,37 +8,37 @@ describe EmailsHelper do
...
@@ -8,37 +8,37 @@ describe EmailsHelper do
end
end
context
'when time limit is less than 2 hours'
do
context
'when time limit is less than 2 hours'
do
it
'
should display
the time in hours using a singular unit'
do
it
'
displays
the time in hours using a singular unit'
do
validate_time_string
(
1
.
hour
,
'1 hour'
)
validate_time_string
(
1
.
hour
,
'1 hour'
)
end
end
end
end
context
'when time limit is 2 or more hours'
do
context
'when time limit is 2 or more hours'
do
it
'
should display
the time in hours using a plural unit'
do
it
'
displays
the time in hours using a plural unit'
do
validate_time_string
(
2
.
hours
,
'2 hours'
)
validate_time_string
(
2
.
hours
,
'2 hours'
)
end
end
end
end
context
'when time limit contains fractions of an hour'
do
context
'when time limit contains fractions of an hour'
do
it
'
should round
down to the nearest hour'
do
it
'
rounds
down to the nearest hour'
do
validate_time_string
(
96
.
minutes
,
'1 hour'
)
validate_time_string
(
96
.
minutes
,
'1 hour'
)
end
end
end
end
context
'when time limit is 24 or more hours'
do
context
'when time limit is 24 or more hours'
do
it
'
should display
the time in days using a singular unit'
do
it
'
displays
the time in days using a singular unit'
do
validate_time_string
(
24
.
hours
,
'1 day'
)
validate_time_string
(
24
.
hours
,
'1 day'
)
end
end
end
end
context
'when time limit is 2 or more days'
do
context
'when time limit is 2 or more days'
do
it
'
should display
the time in days using a plural unit'
do
it
'
displays
the time in days using a plural unit'
do
validate_time_string
(
2
.
days
,
'2 days'
)
validate_time_string
(
2
.
days
,
'2 days'
)
end
end
end
end
context
'when time limit contains fractions of a day'
do
context
'when time limit contains fractions of a day'
do
it
'
should round
down to the nearest day'
do
it
'
rounds
down to the nearest day'
do
validate_time_string
(
57
.
hours
,
'2 days'
)
validate_time_string
(
57
.
hours
,
'2 days'
)
end
end
end
end
...
...
spec/helpers/events_helper_spec.rb
View file @
519275c1
...
@@ -6,34 +6,34 @@ describe EventsHelper do
...
@@ -6,34 +6,34 @@ describe EventsHelper do
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
double
)
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
double
)
end
end
it
'
should display
one line of plain text without alteration'
do
it
'
displays
one line of plain text without alteration'
do
input
=
'A short, plain note'
input
=
'A short, plain note'
expect
(
helper
.
event_note
(
input
)).
to
match
(
input
)
expect
(
helper
.
event_note
(
input
)).
to
match
(
input
)
expect
(
helper
.
event_note
(
input
)).
not_to
match
(
/\.\.\.\z/
)
expect
(
helper
.
event_note
(
input
)).
not_to
match
(
/\.\.\.\z/
)
end
end
it
'
should display
inline code'
do
it
'
displays
inline code'
do
input
=
'A note with `inline code`'
input
=
'A note with `inline code`'
expected
=
'A note with <code>inline code</code>'
expected
=
'A note with <code>inline code</code>'
expect
(
helper
.
event_note
(
input
)).
to
match
(
expected
)
expect
(
helper
.
event_note
(
input
)).
to
match
(
expected
)
end
end
it
'
should truncate
a note with multiple paragraphs'
do
it
'
truncates
a note with multiple paragraphs'
do
input
=
"Paragraph 1
\n\n
Paragraph 2"
input
=
"Paragraph 1
\n\n
Paragraph 2"
expected
=
'Paragraph 1...'
expected
=
'Paragraph 1...'
expect
(
helper
.
event_note
(
input
)).
to
match
(
expected
)
expect
(
helper
.
event_note
(
input
)).
to
match
(
expected
)
end
end
it
'
should display
the first line of a code block'
do
it
'
displays
the first line of a code block'
do
input
=
"```
\n
Code block
\n
with two lines
\n
```"
input
=
"```
\n
Code block
\n
with two lines
\n
```"
expected
=
%r{<pre.+><code>Code block
\.\.\.
</code></pre>}
expected
=
%r{<pre.+><code>Code block
\.\.\.
</code></pre>}
expect
(
helper
.
event_note
(
input
)).
to
match
(
expected
)
expect
(
helper
.
event_note
(
input
)).
to
match
(
expected
)
end
end
it
'
should truncate
a single long line of text'
do
it
'
truncates
a single long line of text'
do
text
=
'The quick brown fox jumped over the lazy dog twice'
# 50 chars
text
=
'The quick brown fox jumped over the lazy dog twice'
# 50 chars
input
=
text
*
4
input
=
text
*
4
expected
=
(
text
*
2
).
sub
(
/.{3}/
,
'...'
)
expected
=
(
text
*
2
).
sub
(
/.{3}/
,
'...'
)
...
@@ -41,7 +41,7 @@ describe EventsHelper do
...
@@ -41,7 +41,7 @@ describe EventsHelper do
expect
(
helper
.
event_note
(
input
)).
to
match
(
expected
)
expect
(
helper
.
event_note
(
input
)).
to
match
(
expected
)
end
end
it
'
should preserve
a link href when link text is truncated'
do
it
'
preserves
a link href when link text is truncated'
do
text
=
'The quick brown fox jumped over the lazy dog'
# 44 chars
text
=
'The quick brown fox jumped over the lazy dog'
# 44 chars
input
=
"
#{
text
}#{
text
}#{
text
}
"
# 133 chars
input
=
"
#{
text
}#{
text
}#{
text
}
"
# 133 chars
link_url
=
'http://example.com/foo/bar/baz'
# 30 chars
link_url
=
'http://example.com/foo/bar/baz'
# 30 chars
...
@@ -52,7 +52,7 @@ describe EventsHelper do
...
@@ -52,7 +52,7 @@ describe EventsHelper do
expect
(
helper
.
event_note
(
input
)).
to
match
(
expected_link_text
)
expect
(
helper
.
event_note
(
input
)).
to
match
(
expected_link_text
)
end
end
it
'
should preserve
code color scheme'
do
it
'
preserves
code color scheme'
do
input
=
"```ruby
\n
def test
\n
'hello world'
\n
end
\n
```"
input
=
"```ruby
\n
def test
\n
'hello world'
\n
end
\n
```"
expected
=
'<pre class="code highlight js-syntax-highlight ruby">'
\
expected
=
'<pre class="code highlight js-syntax-highlight ruby">'
\
"<code><span class=
\"
k
\"
>def</span> <span class=
\"
nf
\"
>test</span>
\n
"
\
"<code><span class=
\"
k
\"
>def</span> <span class=
\"
nf
\"
>test</span>
\n
"
\
...
...
spec/helpers/gitlab_markdown_helper_spec.rb
View file @
519275c1
...
@@ -26,17 +26,17 @@ describe GitlabMarkdownHelper do
...
@@ -26,17 +26,17 @@ describe GitlabMarkdownHelper do
describe
"referencing multiple objects"
do
describe
"referencing multiple objects"
do
let
(
:actual
)
{
"
#{
merge_request
.
to_reference
}
->
#{
commit
.
to_reference
}
->
#{
issue
.
to_reference
}
"
}
let
(
:actual
)
{
"
#{
merge_request
.
to_reference
}
->
#{
commit
.
to_reference
}
->
#{
issue
.
to_reference
}
"
}
it
"
should link
to the merge request"
do
it
"
links
to the merge request"
do
expected
=
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
expected
=
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
expect
(
helper
.
markdown
(
actual
)).
to
match
(
expected
)
expect
(
helper
.
markdown
(
actual
)).
to
match
(
expected
)
end
end
it
"
should link
to the commit"
do
it
"
links
to the commit"
do
expected
=
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
expected
=
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
expect
(
helper
.
markdown
(
actual
)).
to
match
(
expected
)
expect
(
helper
.
markdown
(
actual
)).
to
match
(
expected
)
end
end
it
"
should link
to the issue"
do
it
"
links
to the issue"
do
expected
=
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
expected
=
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
expect
(
helper
.
markdown
(
actual
)).
to
match
(
expected
)
expect
(
helper
.
markdown
(
actual
)).
to
match
(
expected
)
end
end
...
@@ -47,7 +47,7 @@ describe GitlabMarkdownHelper do
...
@@ -47,7 +47,7 @@ describe GitlabMarkdownHelper do
let
(
:second_project
)
{
create
(
:project
,
:public
)
}
let
(
:second_project
)
{
create
(
:project
,
:public
)
}
let
(
:second_issue
)
{
create
(
:issue
,
project:
second_project
)
}
let
(
:second_issue
)
{
create
(
:issue
,
project:
second_project
)
}
it
'
should link
to the issue'
do
it
'
links
to the issue'
do
expected
=
namespace_project_issue_path
(
second_project
.
namespace
,
second_project
,
second_issue
)
expected
=
namespace_project_issue_path
(
second_project
.
namespace
,
second_project
,
second_issue
)
expect
(
markdown
(
actual
,
project:
second_project
)).
to
match
(
expected
)
expect
(
markdown
(
actual
,
project:
second_project
)).
to
match
(
expected
)
end
end
...
@@ -58,7 +58,7 @@ describe GitlabMarkdownHelper do
...
@@ -58,7 +58,7 @@ describe GitlabMarkdownHelper do
let
(
:commit_path
)
{
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
}
let
(
:commit_path
)
{
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
}
let
(
:issues
)
{
create_list
(
:issue
,
2
,
project:
project
)
}
let
(
:issues
)
{
create_list
(
:issue
,
2
,
project:
project
)
}
it
'
should handle
references nested in links with all the text'
do
it
'
handles
references nested in links with all the text'
do
actual
=
helper
.
link_to_gfm
(
"This should finally fix
#{
issues
[
0
].
to_reference
}
and
#{
issues
[
1
].
to_reference
}
for real"
,
commit_path
)
actual
=
helper
.
link_to_gfm
(
"This should finally fix
#{
issues
[
0
].
to_reference
}
and
#{
issues
[
1
].
to_reference
}
for real"
,
commit_path
)
doc
=
Nokogiri
::
HTML
.
parse
(
actual
)
doc
=
Nokogiri
::
HTML
.
parse
(
actual
)
...
@@ -88,7 +88,7 @@ describe GitlabMarkdownHelper do
...
@@ -88,7 +88,7 @@ describe GitlabMarkdownHelper do
expect
(
doc
.
css
(
'a'
)[
4
].
text
).
to
eq
' for real'
expect
(
doc
.
css
(
'a'
)[
4
].
text
).
to
eq
' for real'
end
end
it
'
should forward
HTML options'
do
it
'
forwards
HTML options'
do
actual
=
helper
.
link_to_gfm
(
"Fixed in
#{
commit
.
id
}
"
,
commit_path
,
class:
'foo'
)
actual
=
helper
.
link_to_gfm
(
"Fixed in
#{
commit
.
id
}
"
,
commit_path
,
class:
'foo'
)
doc
=
Nokogiri
::
HTML
.
parse
(
actual
)
doc
=
Nokogiri
::
HTML
.
parse
(
actual
)
...
@@ -110,7 +110,7 @@ describe GitlabMarkdownHelper do
...
@@ -110,7 +110,7 @@ describe GitlabMarkdownHelper do
expect
(
act
).
to
eq
%Q(<a href="/foo">
#{
issues
[
0
].
to_reference
}
</a>)
expect
(
act
).
to
eq
%Q(<a href="/foo">
#{
issues
[
0
].
to_reference
}
</a>)
end
end
it
'
should replace
commit message with emoji to link'
do
it
'
replaces
commit message with emoji to link'
do
actual
=
link_to_gfm
(
':book:Book'
,
'/foo'
)
actual
=
link_to_gfm
(
':book:Book'
,
'/foo'
)
expect
(
actual
).
expect
(
actual
).
to
eq
%Q(<img class="emoji" title=":book:" alt=":book:" src="http://localhost/assets/1F4D6.png" height="20" width="20" align="absmiddle"><a href="/foo">Book</a>)
to
eq
%Q(<img class="emoji" title=":book:" alt=":book:" src="http://localhost/assets/1F4D6.png" height="20" width="20" align="absmiddle"><a href="/foo">Book</a>)
...
@@ -125,7 +125,7 @@ describe GitlabMarkdownHelper do
...
@@ -125,7 +125,7 @@ describe GitlabMarkdownHelper do
helper
.
instance_variable_set
(
:@project_wiki
,
@wiki
)
helper
.
instance_variable_set
(
:@project_wiki
,
@wiki
)
end
end
it
"
should use
Wiki pipeline for markdown files"
do
it
"
uses
Wiki pipeline for markdown files"
do
allow
(
@wiki
).
to
receive
(
:format
).
and_return
(
:markdown
)
allow
(
@wiki
).
to
receive
(
:format
).
and_return
(
:markdown
)
expect
(
helper
).
to
receive
(
:markdown
).
with
(
'wiki content'
,
pipeline: :wiki
,
project_wiki:
@wiki
,
page_slug:
"nested/page"
)
expect
(
helper
).
to
receive
(
:markdown
).
with
(
'wiki content'
,
pipeline: :wiki
,
project_wiki:
@wiki
,
page_slug:
"nested/page"
)
...
@@ -133,7 +133,7 @@ describe GitlabMarkdownHelper do
...
@@ -133,7 +133,7 @@ describe GitlabMarkdownHelper do
helper
.
render_wiki_content
(
@wiki
)
helper
.
render_wiki_content
(
@wiki
)
end
end
it
"
should use
Asciidoctor for asciidoc files"
do
it
"
uses
Asciidoctor for asciidoc files"
do
allow
(
@wiki
).
to
receive
(
:format
).
and_return
(
:asciidoc
)
allow
(
@wiki
).
to
receive
(
:format
).
and_return
(
:asciidoc
)
expect
(
helper
).
to
receive
(
:asciidoc
).
with
(
'wiki content'
)
expect
(
helper
).
to
receive
(
:asciidoc
).
with
(
'wiki content'
)
...
@@ -141,7 +141,7 @@ describe GitlabMarkdownHelper do
...
@@ -141,7 +141,7 @@ describe GitlabMarkdownHelper do
helper
.
render_wiki_content
(
@wiki
)
helper
.
render_wiki_content
(
@wiki
)
end
end
it
"
should use
the Gollum renderer for all other file types"
do
it
"
uses
the Gollum renderer for all other file types"
do
allow
(
@wiki
).
to
receive
(
:format
).
and_return
(
:rdoc
)
allow
(
@wiki
).
to
receive
(
:format
).
and_return
(
:rdoc
)
formatted_content_stub
=
double
(
'formatted_content'
)
formatted_content_stub
=
double
(
'formatted_content'
)
expect
(
formatted_content_stub
).
to
receive
(
:html_safe
)
expect
(
formatted_content_stub
).
to
receive
(
:html_safe
)
...
...
spec/helpers/graph_helper_spec.rb
View file @
519275c1
...
@@ -6,7 +6,7 @@ describe GraphHelper do
...
@@ -6,7 +6,7 @@ describe GraphHelper do
let
(
:commit
)
{
project
.
commit
(
"master"
)
}
let
(
:commit
)
{
project
.
commit
(
"master"
)
}
let
(
:graph
)
{
Network
::
Graph
.
new
(
project
,
'master'
,
commit
,
''
)
}
let
(
:graph
)
{
Network
::
Graph
.
new
(
project
,
'master'
,
commit
,
''
)
}
it
'filter our refs used by GitLab'
do
it
'filter
s
our refs used by GitLab'
do
allow
(
commit
).
to
receive
(
:ref_names
).
and_return
([
'refs/merge-requests/abc'
,
'master'
,
'refs/tmp/xyz'
])
allow
(
commit
).
to
receive
(
:ref_names
).
and_return
([
'refs/merge-requests/abc'
,
'master'
,
'refs/tmp/xyz'
])
self
.
instance_variable_set
(
:@graph
,
graph
)
self
.
instance_variable_set
(
:@graph
,
graph
)
refs
=
get_refs
(
project
.
repository
,
commit
)
refs
=
get_refs
(
project
.
repository
,
commit
)
...
...
spec/helpers/groups_helper_spec.rb
View file @
519275c1
...
@@ -4,7 +4,7 @@ describe GroupsHelper do
...
@@ -4,7 +4,7 @@ describe GroupsHelper do
describe
'group_icon'
do
describe
'group_icon'
do
avatar_file_path
=
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
avatar_file_path
=
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
it
'
should return
an url for the avatar'
do
it
'
returns
an url for the avatar'
do
group
=
create
(
:group
)
group
=
create
(
:group
)
group
.
avatar
=
File
.
open
(
avatar_file_path
)
group
.
avatar
=
File
.
open
(
avatar_file_path
)
group
.
save!
group
.
save!
...
@@ -12,7 +12,7 @@ describe GroupsHelper do
...
@@ -12,7 +12,7 @@ describe GroupsHelper do
to
match
(
"/uploads/group/avatar/
#{
group
.
id
}
/banana_sample.gif"
)
to
match
(
"/uploads/group/avatar/
#{
group
.
id
}
/banana_sample.gif"
)
end
end
it
'
should give
default avatar_icon when no avatar is present'
do
it
'
gives
default avatar_icon when no avatar is present'
do
group
=
create
(
:group
)
group
=
create
(
:group
)
group
.
save!
group
.
save!
expect
(
group_icon
(
group
.
path
)).
to
match
(
'group_avatar.png'
)
expect
(
group_icon
(
group
.
path
)).
to
match
(
'group_avatar.png'
)
...
...
spec/helpers/issues_helper_spec.rb
View file @
519275c1
...
@@ -10,18 +10,19 @@ describe IssuesHelper do
...
@@ -10,18 +10,19 @@ describe IssuesHelper do
let
(
:ext_expected
)
{
issues_url
.
gsub
(
':id'
,
issue
.
iid
.
to_s
).
gsub
(
':project_id'
,
ext_project
.
id
.
to_s
)
}
let
(
:ext_expected
)
{
issues_url
.
gsub
(
':id'
,
issue
.
iid
.
to_s
).
gsub
(
':project_id'
,
ext_project
.
id
.
to_s
)
}
let
(
:int_expected
)
{
polymorphic_path
([
@project
.
namespace
,
project
,
issue
])
}
let
(
:int_expected
)
{
polymorphic_path
([
@project
.
namespace
,
project
,
issue
])
}
it
"
should return
internal path if used internal tracker"
do
it
"
returns
internal path if used internal tracker"
do
@project
=
project
@project
=
project
expect
(
url_for_issue
(
issue
.
iid
)).
to
match
(
int_expected
)
expect
(
url_for_issue
(
issue
.
iid
)).
to
match
(
int_expected
)
end
end
it
"
should return
path to external tracker"
do
it
"
returns
path to external tracker"
do
@project
=
ext_project
@project
=
ext_project
expect
(
url_for_issue
(
issue
.
iid
)).
to
match
(
ext_expected
)
expect
(
url_for_issue
(
issue
.
iid
)).
to
match
(
ext_expected
)
end
end
it
"
should return
empty string if project nil"
do
it
"
returns
empty string if project nil"
do
@project
=
nil
@project
=
nil
expect
(
url_for_issue
(
issue
.
iid
)).
to
eq
""
expect
(
url_for_issue
(
issue
.
iid
)).
to
eq
""
...
@@ -45,7 +46,7 @@ describe IssuesHelper do
...
@@ -45,7 +46,7 @@ describe IssuesHelper do
allow
(
Gitlab
.
config
).
to
receive
(
:issues_tracker
).
and_return
(
nil
)
allow
(
Gitlab
.
config
).
to
receive
(
:issues_tracker
).
and_return
(
nil
)
end
end
it
"
should return
external path"
do
it
"
returns
external path"
do
expect
(
url_for_issue
(
issue
.
iid
)).
to
match
(
ext_expected
)
expect
(
url_for_issue
(
issue
.
iid
)).
to
match
(
ext_expected
)
end
end
end
end
...
...
spec/helpers/notes_helper_spec.rb
View file @
519275c1
...
@@ -21,7 +21,7 @@ describe NotesHelper do
...
@@ -21,7 +21,7 @@ describe NotesHelper do
end
end
describe
"#notes_max_access_for_users"
do
describe
"#notes_max_access_for_users"
do
it
'return human access levels'
do
it
'return
s
human access levels'
do
expect
(
helper
.
note_max_access_for_user
(
owner_note
)).
to
eq
(
'Owner'
)
expect
(
helper
.
note_max_access_for_user
(
owner_note
)).
to
eq
(
'Owner'
)
expect
(
helper
.
note_max_access_for_user
(
master_note
)).
to
eq
(
'Master'
)
expect
(
helper
.
note_max_access_for_user
(
master_note
)).
to
eq
(
'Master'
)
expect
(
helper
.
note_max_access_for_user
(
reporter_note
)).
to
eq
(
'Reporter'
)
expect
(
helper
.
note_max_access_for_user
(
reporter_note
)).
to
eq
(
'Reporter'
)
...
...
spec/helpers/search_helper_spec.rb
View file @
519275c1
...
@@ -42,7 +42,7 @@ describe SearchHelper do
...
@@ -42,7 +42,7 @@ describe SearchHelper do
expect
(
search_autocomplete_opts
(
project
.
name
).
size
).
to
eq
(
1
)
expect
(
search_autocomplete_opts
(
project
.
name
).
size
).
to
eq
(
1
)
end
end
it
"
should
not include the public group"
do
it
"
does
not include the public group"
do
group
=
create
(
:group
)
group
=
create
(
:group
)
expect
(
search_autocomplete_opts
(
group
.
name
).
size
).
to
eq
(
0
)
expect
(
search_autocomplete_opts
(
group
.
name
).
size
).
to
eq
(
0
)
end
end
...
...
spec/helpers/submodule_helper_spec.rb
View file @
519275c1
...
@@ -17,35 +17,35 @@ describe SubmoduleHelper do
...
@@ -17,35 +17,35 @@ describe SubmoduleHelper do
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:protocol
).
and_return
(
'http'
)
# set this just to be sure
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:protocol
).
and_return
(
'http'
)
# set this just to be sure
end
end
it
'
should detect
ssh on standard port'
do
it
'
detects
ssh on standard port'
do
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_port
).
and_return
(
22
)
# set this just to be sure
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_port
).
and_return
(
22
)
# set this just to be sure
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_path_prefix
).
and_return
(
Settings
.
send
(
:build_gitlab_shell_ssh_path_prefix
))
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_path_prefix
).
and_return
(
Settings
.
send
(
:build_gitlab_shell_ssh_path_prefix
))
stub_url
([
config
.
user
,
'@'
,
config
.
host
,
':gitlab-org/gitlab-ce.git'
].
join
(
''
))
stub_url
([
config
.
user
,
'@'
,
config
.
host
,
':gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
end
end
it
'
should detect
ssh on non-standard port'
do
it
'
detects
ssh on non-standard port'
do
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_port
).
and_return
(
2222
)
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_port
).
and_return
(
2222
)
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_path_prefix
).
and_return
(
Settings
.
send
(
:build_gitlab_shell_ssh_path_prefix
))
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_path_prefix
).
and_return
(
Settings
.
send
(
:build_gitlab_shell_ssh_path_prefix
))
stub_url
([
'ssh://'
,
config
.
user
,
'@'
,
config
.
host
,
':2222/gitlab-org/gitlab-ce.git'
].
join
(
''
))
stub_url
([
'ssh://'
,
config
.
user
,
'@'
,
config
.
host
,
':2222/gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
end
end
it
'
should detect
http on standard port'
do
it
'
detects
http on standard port'
do
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:port
).
and_return
(
80
)
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:port
).
and_return
(
80
)
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:url
).
and_return
(
Settings
.
send
(
:build_gitlab_url
))
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:url
).
and_return
(
Settings
.
send
(
:build_gitlab_url
))
stub_url
([
'http://'
,
config
.
host
,
'/gitlab-org/gitlab-ce.git'
].
join
(
''
))
stub_url
([
'http://'
,
config
.
host
,
'/gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
end
end
it
'
should detect
http on non-standard port'
do
it
'
detects
http on non-standard port'
do
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:port
).
and_return
(
3000
)
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:port
).
and_return
(
3000
)
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:url
).
and_return
(
Settings
.
send
(
:build_gitlab_url
))
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:url
).
and_return
(
Settings
.
send
(
:build_gitlab_url
))
stub_url
([
'http://'
,
config
.
host
,
':3000/gitlab-org/gitlab-ce.git'
].
join
(
''
))
stub_url
([
'http://'
,
config
.
host
,
':3000/gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
end
end
it
'
should work
with relative_url_root'
do
it
'
works
with relative_url_root'
do
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:port
).
and_return
(
80
)
# set this just to be sure
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:port
).
and_return
(
80
)
# set this just to be sure
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:relative_url_root
).
and_return
(
'/gitlab/root'
)
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:relative_url_root
).
and_return
(
'/gitlab/root'
)
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:url
).
and_return
(
Settings
.
send
(
:build_gitlab_url
))
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:url
).
and_return
(
Settings
.
send
(
:build_gitlab_url
))
...
@@ -55,22 +55,22 @@ describe SubmoduleHelper do
...
@@ -55,22 +55,22 @@ describe SubmoduleHelper do
end
end
context
'submodule on github.com'
do
context
'submodule on github.com'
do
it
'
should detect
ssh'
do
it
'
detects
ssh'
do
stub_url
(
'git@github.com:gitlab-org/gitlab-ce.git'
)
stub_url
(
'git@github.com:gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://github.com/gitlab-org/gitlab-ce'
,
'https://github.com/gitlab-org/gitlab-ce/tree/hash'
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://github.com/gitlab-org/gitlab-ce'
,
'https://github.com/gitlab-org/gitlab-ce/tree/hash'
])
end
end
it
'
should detect
http'
do
it
'
detects
http'
do
stub_url
(
'http://github.com/gitlab-org/gitlab-ce.git'
)
stub_url
(
'http://github.com/gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://github.com/gitlab-org/gitlab-ce'
,
'https://github.com/gitlab-org/gitlab-ce/tree/hash'
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://github.com/gitlab-org/gitlab-ce'
,
'https://github.com/gitlab-org/gitlab-ce/tree/hash'
])
end
end
it
'
should detect
https'
do
it
'
detects
https'
do
stub_url
(
'https://github.com/gitlab-org/gitlab-ce.git'
)
stub_url
(
'https://github.com/gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://github.com/gitlab-org/gitlab-ce'
,
'https://github.com/gitlab-org/gitlab-ce/tree/hash'
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://github.com/gitlab-org/gitlab-ce'
,
'https://github.com/gitlab-org/gitlab-ce/tree/hash'
])
end
end
it
'
should return
original with non-standard url'
do
it
'
returns
original with non-standard url'
do
stub_url
(
'http://github.com/gitlab-org/gitlab-ce'
)
stub_url
(
'http://github.com/gitlab-org/gitlab-ce'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
...
@@ -80,22 +80,22 @@ describe SubmoduleHelper do
...
@@ -80,22 +80,22 @@ describe SubmoduleHelper do
end
end
context
'submodule on gitlab.com'
do
context
'submodule on gitlab.com'
do
it
'
should detect
ssh'
do
it
'
detects
ssh'
do
stub_url
(
'git@gitlab.com:gitlab-org/gitlab-ce.git'
)
stub_url
(
'git@gitlab.com:gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://gitlab.com/gitlab-org/gitlab-ce'
,
'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash'
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://gitlab.com/gitlab-org/gitlab-ce'
,
'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash'
])
end
end
it
'
should detect
http'
do
it
'
detects
http'
do
stub_url
(
'http://gitlab.com/gitlab-org/gitlab-ce.git'
)
stub_url
(
'http://gitlab.com/gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://gitlab.com/gitlab-org/gitlab-ce'
,
'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash'
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://gitlab.com/gitlab-org/gitlab-ce'
,
'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash'
])
end
end
it
'
should detect
https'
do
it
'
detects
https'
do
stub_url
(
'https://gitlab.com/gitlab-org/gitlab-ce.git'
)
stub_url
(
'https://gitlab.com/gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://gitlab.com/gitlab-org/gitlab-ce'
,
'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash'
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://gitlab.com/gitlab-org/gitlab-ce'
,
'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash'
])
end
end
it
'
should return
original with non-standard url'
do
it
'
returns
original with non-standard url'
do
stub_url
(
'http://gitlab.com/gitlab-org/gitlab-ce'
)
stub_url
(
'http://gitlab.com/gitlab-org/gitlab-ce'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
...
@@ -105,7 +105,7 @@ describe SubmoduleHelper do
...
@@ -105,7 +105,7 @@ describe SubmoduleHelper do
end
end
context
'submodule on unsupported'
do
context
'submodule on unsupported'
do
it
'
should return
original'
do
it
'
returns
original'
do
stub_url
(
'http://mygitserver.com/gitlab-org/gitlab-ce'
)
stub_url
(
'http://mygitserver.com/gitlab-org/gitlab-ce'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
...
...
spec/helpers/tree_helper_spec.rb
View file @
519275c1
...
@@ -12,7 +12,7 @@ describe TreeHelper do
...
@@ -12,7 +12,7 @@ describe TreeHelper do
context
"on a directory containing more than one file/directory"
do
context
"on a directory containing more than one file/directory"
do
let
(
:tree_item
)
{
double
(
name:
"files"
,
path:
"files"
)
}
let
(
:tree_item
)
{
double
(
name:
"files"
,
path:
"files"
)
}
it
"
should return
the directory name"
do
it
"
returns
the directory name"
do
expect
(
flatten_tree
(
tree_item
)).
to
match
(
'files'
)
expect
(
flatten_tree
(
tree_item
)).
to
match
(
'files'
)
end
end
end
end
...
@@ -20,7 +20,7 @@ describe TreeHelper do
...
@@ -20,7 +20,7 @@ describe TreeHelper do
context
"on a directory containing only one directory"
do
context
"on a directory containing only one directory"
do
let
(
:tree_item
)
{
double
(
name:
"foo"
,
path:
"foo"
)
}
let
(
:tree_item
)
{
double
(
name:
"foo"
,
path:
"foo"
)
}
it
"
should return
the flattened path"
do
it
"
returns
the flattened path"
do
expect
(
flatten_tree
(
tree_item
)).
to
match
(
'foo/bar'
)
expect
(
flatten_tree
(
tree_item
)).
to
match
(
'foo/bar'
)
end
end
end
end
...
...
spec/lib/ci/charts_spec.rb
View file @
519275c1
...
@@ -7,12 +7,12 @@ describe Ci::Charts, lib: true do
...
@@ -7,12 +7,12 @@ describe Ci::Charts, lib: true do
FactoryGirl
.
create
(
:ci_build
,
pipeline:
@pipeline
)
FactoryGirl
.
create
(
:ci_build
,
pipeline:
@pipeline
)
end
end
it
'
should return
build times in minutes'
do
it
'
returns
build times in minutes'
do
chart
=
Ci
::
Charts
::
BuildTime
.
new
(
@pipeline
.
project
)
chart
=
Ci
::
Charts
::
BuildTime
.
new
(
@pipeline
.
project
)
expect
(
chart
.
build_times
).
to
eq
([
2
])
expect
(
chart
.
build_times
).
to
eq
([
2
])
end
end
it
'
should handle
nil build times'
do
it
'
handles
nil build times'
do
create
(
:ci_pipeline
,
duration:
nil
,
project:
@pipeline
.
project
)
create
(
:ci_pipeline
,
duration:
nil
,
project:
@pipeline
.
project
)
chart
=
Ci
::
Charts
::
BuildTime
.
new
(
@pipeline
.
project
)
chart
=
Ci
::
Charts
::
BuildTime
.
new
(
@pipeline
.
project
)
...
...
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