Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
fa864716
Commit
fa864716
authored
Apr 13, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new "clear all" button in tests
parent
b60b9094
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
36 deletions
+49
-36
spec/features/admin/admin_projects_spec.rb
spec/features/admin/admin_projects_spec.rb
+1
-36
spec/features/admin/admin_uses_repository_checks_spec.rb
spec/features/admin/admin_uses_repository_checks_spec.rb
+48
-0
No files found.
spec/features/admin/admin_projects_spec.rb
View file @
fa864716
require
'spec_helper'
require
'spec_helper'
require
'rails_helper'
describe
"Admin
Projects"
,
feature:
true
do
describe
"Admin
::
Projects"
,
feature:
true
do
before
do
before
do
@project
=
create
(
:project
)
@project
=
create
(
:project
)
login_as
:admin
login_as
:admin
...
@@ -32,38 +31,4 @@ describe "Admin Projects", feature: true do
...
@@ -32,38 +31,4 @@ describe "Admin Projects", feature: true do
expect
(
page
).
to
have_content
(
@project
.
name
)
expect
(
page
).
to
have_content
(
@project
.
name
)
end
end
end
end
feature
'repository checks'
do
scenario
'trigger repository check'
do
visit_admin_project_page
page
.
within
(
'.repository-check'
)
do
click_button
'Trigger repository check'
end
expect
(
page
).
to
have_content
(
'Repository check was triggered'
)
end
scenario
'see failed repository check'
do
@project
.
update_column
(
:last_repository_check_failed
,
true
)
visit_admin_project_page
expect
(
page
).
to
have_content
(
'Last repository check failed'
)
end
scenario
'clear repository checks'
,
js:
true
do
@project
.
update_column
(
:last_repository_check_failed
,
true
)
visit
admin_namespaces_projects_path
page
.
within
(
'.repository-check-states'
)
do
click_link
'Clear all'
# pop-up should be auto confirmed
end
expect
(
@project
.
reload
.
last_repository_check_failed
).
to
eq
(
false
)
end
end
def
visit_admin_project_page
visit
admin_namespace_project_path
(
@project
.
namespace
,
@project
)
end
end
end
spec/features/admin/admin_uses_repository_checks_spec.rb
0 → 100644
View file @
fa864716
require
'rails_helper'
feature
'Admin uses repository checks'
,
feature:
true
do
before
do
login_as
:admin
end
scenario
'to trigger a single check'
do
project
=
create
(
:empty_project
)
visit_admin_project_page
(
project
)
page
.
within
(
'.repository-check'
)
do
click_button
'Trigger repository check'
end
expect
(
page
).
to
have_content
(
'Repository check was triggered'
)
end
scenario
'to see a single failed repository check'
do
visit_admin_project_page
(
broken_project
)
page
.
within
(
'.alert'
)
do
expect
(
page
.
text
).
to
match
(
/Last repository check \(.* ago\) failed/
)
end
end
scenario
'to clear all repository checks'
,
js:
true
do
project
=
broken_project
visit
admin_application_settings_path
click_link
'Clear all repository checks'
# pop-up should be auto confirmed
expect
(
project
.
reload
.
last_repository_check_failed
).
to
eq
(
false
)
end
def
visit_admin_project_page
(
project
)
visit
admin_namespace_project_path
(
project
.
namespace
,
project
)
end
def
broken_project
project
=
create
(
:empty_project
)
project
.
update_columns
(
last_repository_check_failed:
true
,
last_repository_check_at:
Time
.
now
,
)
project
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