OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[31531] Fix visiting history wiki content
Oliver Güntherd0016796738d
diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erbindex e35ce461c0a..1c727c9b9f6 100644--- a/app/views/wiki/show.html.erb+++ b/app/views/wiki/show.html.erb@@ -36,7 +36,7 @@ See docs/COPYRIGHT.rdoc for more details.<%# Set meta tags %><% title "#{t(:project_module_wiki)} | #{title}" %>-<% @formatted_text = format_text @page.content, :text, attachments: @page.attachments %>+<% @formatted_text = format_text (@content || @page.content), :text, attachments: @page.attachments %><% description strip_tags(@formatted_text) %><%= toolbar title: title, html: {class: '-with-dropdown'} do %>diff --git a/spec/features/wiki/adding_editing_history_spec.rb b/spec/features/wiki/adding_editing_history_spec.rbindex 1f182632422..1fc85aedd50 100644--- a/spec/features/wiki/adding_editing_history_spec.rb+++ b/spec/features/wiki/adding_editing_history_spec.rb@@ -98,5 +98,20 @@ describe 'wiki pages', type: :feature, js: true doexpect(page).to have_selector('ins.diffmod', text: 'second')expect(page).to have_selector('del.diffmod', text: 'first')end++ # Go back to history+ find('.button', text: 'History').click++ # Click on first version+ # to determine text (Regression test #31531)+ find('td.id a', text: 1).click++ expect(page).to have_selector('.wiki-version--details', text: 'Version 1/2')+ expect(page).to have_selector('.wiki-content', text: content_first_version)++ find('.button', text: 'Next').click++ expect(page).to have_selector('.wiki-version--details', text: 'Version 2/2')+ expect(page).to have_selector('.wiki-content', text: content_second_version)endend