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
58e5d651
Commit
58e5d651
authored
Jul 27, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix remote mirror last_update_at nil error in view
parent
248ddf26
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
app/views/projects/mirrors/_push.html.haml
app/views/projects/mirrors/_push.html.haml
+5
-1
spec/features/projects/remote_mirror_spec.rb
spec/features/projects/remote_mirror_spec.rb
+34
-0
No files found.
app/views/projects/mirrors/_push.html.haml
View file @
58e5d651
...
...
@@ -17,7 +17,11 @@
-
if
@remote_mirror
.
last_error
.
present?
.panel.panel-danger
.panel-heading
-
if
@remote_mirror
.
last_update_at
The remote repository failed to update
#{
time_ago_with_tooltip
(
@remote_mirror
.
last_update_at
)
}
.
-
else
The remote repository failed to update.
-
if
@remote_mirror
.
last_successful_update_at
Last successful update
#{
time_ago_with_tooltip
(
@remote_mirror
.
last_successful_update_at
)
}
.
.panel-body
...
...
spec/features/projects/remote_mirror_spec.rb
0 → 100644
View file @
58e5d651
require
'spec_helper'
feature
'Project remote mirror'
,
feature:
true
do
let
(
:project
)
{
create
(
:project
,
:remote_mirror
)
}
let
(
:remote_mirror
)
{
project
.
remote_mirrors
.
first
}
let
(
:user
)
{
create
(
:user
)
}
describe
'On a project'
,
js:
true
do
before
do
project
.
team
<<
[
user
,
:master
]
sign_in
user
end
context
'when last_error is present but last_update_at is not'
do
it
'renders error message without timstamp'
do
remote_mirror
.
update_attributes
(
last_error:
'Some new error'
,
last_update_at:
nil
)
visit
project_mirror_path
(
project
)
expect
(
page
).
to
have_content
(
'The remote repository failed to update.'
)
end
end
context
'when last_error and last_update_at are present'
do
it
'renders error message with timestamp'
do
remote_mirror
.
update_attributes
(
last_error:
'Some new error'
,
last_update_at:
Time
.
now
-
5
.
minutes
)
visit
project_mirror_path
(
project
)
expect
(
page
).
to
have_content
(
'The remote repository failed to update 5 minutes ago.'
)
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment