summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2017-06-03 21:40:59 -0500
committerRuben Davila <rdavila84@gmail.com>2017-06-03 21:40:59 -0500
commit44affff387e1a4406f3e030894caf73e8d41a064 (patch)
tree28e0a37aceba82a3da16e62e47024ef95e1dab05
parent39340e428e3546d3749498ce10b19ae6cda0e646 (diff)
downloadgitlab-ce-32869-project-s-last-updated-time-not-accurately-reflected-in-projects-dashboard.tar.gz
Use last_activity_at attr when showing the update date in project listing32869-project-s-last-updated-time-not-accurately-reflected-in-projects-dashboard
-rw-r--r--app/views/shared/projects/_project.html.haml2
-rw-r--r--spec/features/dashboard/projects_spec.rb9
2 files changed, 10 insertions, 1 deletions
diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml
index cf0540afb38..fbc335f6176 100644
--- a/app/views/shared/projects/_project.html.haml
+++ b/app/views/shared/projects/_project.html.haml
@@ -7,7 +7,7 @@
- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && project.commit
- css_class += " no-description" if project.description.blank? && !show_last_commit_as_description
- cache_key = project_list_cache_key(project)
-- updated_tooltip = time_ago_with_tooltip(project.updated_at)
+- updated_tooltip = time_ago_with_tooltip(project.last_activity_at)
%li.project-row{ class: css_class }
= cache(cache_key) do
diff --git a/spec/features/dashboard/projects_spec.rb b/spec/features/dashboard/projects_spec.rb
index fa3435ab719..3568954a548 100644
--- a/spec/features/dashboard/projects_spec.rb
+++ b/spec/features/dashboard/projects_spec.rb
@@ -15,6 +15,15 @@ RSpec.describe 'Dashboard Projects', feature: true do
expect(page).to have_content('awesome stuff')
end
+ it 'shows the last_activity_at attribute as the update date' do
+ now = Time.now
+ project.update_column(:last_activity_at, now)
+
+ visit dashboard_projects_path
+
+ expect(page).to have_xpath("//time[@datetime='#{now.getutc.iso8601}']")
+ end
+
context 'when on Starred projects tab' do
it 'shows only starred projects' do
user.toggle_star(project2)