Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
08a6a45c
Commit
08a6a45c
authored
Apr 11, 2018
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Spec improvements for speed, reliability and readability
parent
4a01c684
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
25 additions
and
29 deletions
+25
-29
spec/controllers/projects/issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+1
-1
spec/features/merge_request/user_awards_emoji_spec.rb
spec/features/merge_request/user_awards_emoji_spec.rb
+1
-1
spec/features/projects/awards/user_interacts_with_awards_in_issue_spec.rb
...ojects/awards/user_interacts_with_awards_in_issue_spec.rb
+2
-2
spec/features/projects/branches_spec.rb
spec/features/projects/branches_spec.rb
+1
-1
spec/features/projects/commit/cherry_pick_spec.rb
spec/features/projects/commit/cherry_pick_spec.rb
+2
-1
spec/features/projects/commit/user_reverts_commit_spec.rb
spec/features/projects/commit/user_reverts_commit_spec.rb
+1
-1
spec/features/projects/files/user_edits_files_spec.rb
spec/features/projects/files/user_edits_files_spec.rb
+5
-9
spec/features/projects/issues/user_views_issue_spec.rb
spec/features/projects/issues/user_views_issue_spec.rb
+11
-11
spec/features/projects/merge_requests/user_views_open_merge_requests_spec.rb
...cts/merge_requests/user_views_open_merge_requests_spec.rb
+1
-1
spec/views/projects/commit/_commit_box.html.haml_spec.rb
spec/views/projects/commit/_commit_box.html.haml_spec.rb
+0
-1
No files found.
spec/controllers/projects/issues_controller_spec.rb
View file @
08a6a45c
...
@@ -956,7 +956,7 @@ describe Projects::IssuesController do
...
@@ -956,7 +956,7 @@ describe Projects::IssuesController do
end
end
it
'is not available when the project is archived'
do
it
'is not available when the project is archived'
do
project
.
update
(
archived:
true
)
project
.
update
!
(
archived:
true
)
create_merge_request
create_merge_request
...
...
spec/features/merge_request/user_awards_emoji_spec.rb
View file @
08a6a45c
...
@@ -37,7 +37,7 @@ describe 'Merge request > User awards emoji', :js do
...
@@ -37,7 +37,7 @@ describe 'Merge request > User awards emoji', :js do
end
end
describe
'the project is archived'
do
describe
'the project is archived'
do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
archived:
true
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
:archived
)
}
it
'does 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'
)
...
...
spec/features/projects/awards/user_interacts_with_awards_in_issue_spec.rb
View file @
08a6a45c
...
@@ -103,7 +103,7 @@ describe 'User interacts with awards in an issue', :js do
...
@@ -103,7 +103,7 @@ describe 'User interacts with awards in an issue', :js do
end
end
context
'when a project is archived'
do
context
'when a project is archived'
do
let
(
:project
)
{
create
(
:project
,
archived:
true
)
}
let
(
:project
)
{
create
(
:project
,
:archived
)
}
it
'hides the add award button'
do
it
'hides the add award button'
do
page
.
within
(
'.awards'
)
do
page
.
within
(
'.awards'
)
do
...
@@ -147,7 +147,7 @@ describe 'User interacts with awards in an issue', :js do
...
@@ -147,7 +147,7 @@ describe 'User interacts with awards in an issue', :js do
end
end
context
'when the project is archived'
do
context
'when the project is archived'
do
let
(
:project
)
{
create
(
:project
,
archived:
true
)
}
let
(
:project
)
{
create
(
:project
,
:archived
)
}
it
'hides the buttons for adding new emoji'
do
it
'hides the buttons for adding new emoji'
do
page
.
within
(
'.note-awards'
)
do
page
.
within
(
'.note-awards'
)
do
...
...
spec/features/projects/branches_spec.rb
View file @
08a6a45c
...
@@ -207,7 +207,7 @@ describe 'Branches' do
...
@@ -207,7 +207,7 @@ describe 'Branches' do
end
end
context
'when the project is archived'
do
context
'when the project is archived'
do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
archived:
true
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
:archived
)
}
it
'does not show the merge request button when the project is archived'
do
it
'does not show the merge request button when the project is archived'
do
visit
project_branches_path
(
project
)
visit
project_branches_path
(
project
)
...
...
spec/features/projects/commit/cherry_pick_spec.rb
View file @
08a6a45c
...
@@ -91,11 +91,12 @@ describe 'Cherry-pick Commits' do
...
@@ -91,11 +91,12 @@ describe 'Cherry-pick Commits' do
end
end
context
'when the project is archived'
do
context
'when the project is archived'
do
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
group
,
archived:
true
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:archived
,
namespace:
group
)
}
it
'does not show the cherry-pick link'
do
it
'does not show the cherry-pick link'
do
find
(
'.header-action-buttons a.dropdown-toggle'
).
click
find
(
'.header-action-buttons a.dropdown-toggle'
).
click
expect
(
page
).
not_to
have_text
(
"Cherry-pick"
)
expect
(
page
).
not_to
have_css
(
"a[href='#modal-cherry-pick-commit']"
)
expect
(
page
).
not_to
have_css
(
"a[href='#modal-cherry-pick-commit']"
)
end
end
end
end
...
...
spec/features/projects/commit/user_reverts_commit_spec.rb
View file @
08a6a45c
...
@@ -62,7 +62,7 @@ describe 'User reverts a commit', :js do
...
@@ -62,7 +62,7 @@ describe 'User reverts a commit', :js do
end
end
context
'when the project is archived'
do
context
'when the project is archived'
do
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
,
archived:
tru
e
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:archived
,
namespace:
user
.
namespac
e
)
}
it
'does not show the revert link'
do
it
'does not show the revert link'
do
find
(
'.header-action-buttons .dropdown'
).
click
find
(
'.header-action-buttons .dropdown'
).
click
...
...
spec/features/projects/files/user_edits_files_spec.rb
View file @
08a6a45c
...
@@ -20,15 +20,11 @@ describe 'Projects > Files > User edits files' do
...
@@ -20,15 +20,11 @@ describe 'Projects > Files > User edits files' do
click_link
(
'.gitignore'
)
click_link
(
'.gitignore'
)
aggregate_failures
'available edit buttons'
do
aggregate_failures
'available edit buttons'
do
# We're showing a link, if the user can edit directly, this is becomes a
expect
(
page
).
not_to
have_text
(
'Edit'
)
# button when the user can fork the project.
expect
(
page
).
not_to
have_text
(
'Web IDE'
)
expect
(
page
).
not_to
have_link
(
'Edit'
)
expect
(
page
).
not_to
have_button
(
'Edit'
)
expect
(
page
).
not_to
have_text
(
'Replace'
)
expect
(
page
).
not_to
have_link
(
'Web IDE'
)
expect
(
page
).
not_to
have_text
(
'Delete'
)
expect
(
page
).
not_to
have_button
(
'Web IDE'
)
expect
(
page
).
not_to
have_button
(
'Replace'
)
expect
(
page
).
not_to
have_button
(
'Delete'
)
end
end
end
end
end
end
...
...
spec/features/projects/issues/user_views_issue_spec.rb
View file @
08a6a45c
...
@@ -14,19 +14,19 @@ describe "User views issue" do
...
@@ -14,19 +14,19 @@ describe "User views issue" do
it
{
expect
(
page
).
to
have_header_with_correct_id_and_link
(
1
,
"Description header"
,
"description-header"
)
}
it
{
expect
(
page
).
to
have_header_with_correct_id_and_link
(
1
,
"Description header"
,
"description-header"
)
}
it
{
expect
(
page
).
to
have_link
(
'New issue'
)
}
it
'shows the merge request and issue actions'
,
:aggregate_failures
do
expect
(
page
).
to
have_link
(
'New issue'
)
it
{
expect
(
page
).
to
have_button
(
'Create merge request'
)
}
expect
(
page
).
to
have_button
(
'Create merge request'
)
expect
(
page
).
to
have_link
(
'Close issue'
)
it
{
expect
(
page
).
to
have_link
(
'Close issue'
)
}
end
context
'when the project is archived'
do
context
'when the project is archived'
do
let
(
:project
)
{
create
(
:project
,
:public
,
archived:
true
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:archived
)
}
it
{
expect
(
page
).
not_to
have_link
(
'New issue'
)
}
it
'hides the merge request and issue actions'
,
:aggregate_failures
do
expect
(
page
).
not_to
have_link
(
'New issue'
)
it
{
expect
(
page
).
not_to
have_button
(
'Create merge request'
)
}
expect
(
page
).
not_to
have_button
(
'Create merge request'
)
expect
(
page
).
not_to
have_link
(
'Close issue'
)
it
{
expect
(
page
).
not_to
have_link
(
'Close issue'
)
}
end
end
end
end
end
spec/features/projects/merge_requests/user_views_open_merge_requests_spec.rb
View file @
08a6a45c
...
@@ -100,7 +100,7 @@ describe 'User views open merge requests' do
...
@@ -100,7 +100,7 @@ describe 'User views open merge requests' do
end
end
context
'when the project is archived'
do
context
'when the project is archived'
do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
archived:
true
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
:archived
)
}
it
'hides the new merge request button'
do
it
'hides the new merge request button'
do
expect
(
page
).
not_to
have_link
(
'New merge request'
)
expect
(
page
).
not_to
have_link
(
'New merge request'
)
...
...
spec/views/projects/commit/_commit_box.html.haml_spec.rb
View file @
08a6a45c
...
@@ -7,7 +7,6 @@ describe 'projects/commit/_commit_box.html.haml' do
...
@@ -7,7 +7,6 @@ describe 'projects/commit/_commit_box.html.haml' do
before
do
before
do
assign
(
:project
,
project
)
assign
(
:project
,
project
)
assign
(
:commit
,
project
.
commit
)
assign
(
:commit
,
project
.
commit
)
assign
(
:current_user
,
user
)
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
view
).
to
receive
(
:can_collaborate_with_project?
).
and_return
(
false
)
allow
(
view
).
to
receive
(
:can_collaborate_with_project?
).
and_return
(
false
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment