diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-06-05 21:12:49 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-06-05 21:12:49 +0300 |
commit | db14daf5e5063578c947d28273f4148f7ec60513 (patch) | |
tree | 34f0a8ea35ffca5b1dfbf990dc0ab5030e4dbfe7 | |
parent | 5872273841ad7080fb2c8addaeb67712d1b8bf37 (diff) | |
parent | 44affff387e1a4406f3e030894caf73e8d41a064 (diff) |
Merge branch '32869-project-s-last-updated-time-not-accurately-reflected-in-projects-dashboard' into 'master'
Use last_activity_at attr when showing the update date in project listing
Closes #32869
See merge request !11896
-rw-r--r-- | app/views/shared/projects/_project.html.haml | 2 | ||||
-rw-r--r-- | spec/features/dashboard/projects_spec.rb | 9 |
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) |