From 86de72c0050a4d2f8174ede4b3354d149c6533da Mon Sep 17 00:00:00 2001 From: Massimo Rossello Date: Sun, 15 Dec 2019 18:05:37 +0100 Subject: [PATCH] Better adaptation to Redmine 4.0 --- .gitignore | 14 ++++++++++++++ README.md | 2 +- .../show/project_custom_fields.html.erb.deface | 2 +- init.rb | 2 +- test/functional/projects_controller_test.rb | 7 ++++--- 5 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed792b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +.buildpath +.byebug_history +.metadata/ +.project +Gemfile.lock +config/ +coverage/ +db/ +files/ +log/ +public/ +test/html_reports/ +tmp/ + diff --git a/README.md b/README.md index b34532b..a28692f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Redmine Better Overview -Compatible with Redmine 2.6.x-3.4.x. +Compatible with Redmine 4.0.x. Provides a better projects overview. diff --git a/app/overrides/projects/show/project_custom_fields.html.erb.deface b/app/overrides/projects/show/project_custom_fields.html.erb.deface index 3457e09..05dcb02 100644 --- a/app/overrides/projects/show/project_custom_fields.html.erb.deface +++ b/app/overrides/projects/show/project_custom_fields.html.erb.deface @@ -1,5 +1,5 @@
-

<%= custom_field.name %>

+

<%= custom_field.name %>

<%= formatted %>
diff --git a/init.rb b/init.rb index 662e8fc..8ba2371 100644 --- a/init.rb +++ b/init.rb @@ -30,7 +30,7 @@ version '1.0.0' url 'https://github.com/maxrossello/redmine_better_overview.git' author_url 'https://github.com/maxrossello' - requires_redmine :version_or_higher => '2.6.0' + requires_redmine :version_or_higher => '4.0.0' end Rails.configuration.to_prepare do diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 145601b..746bec5 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -49,14 +49,15 @@ def test_show_should_display_homepage_in_a_box end def test_show_should_display_visible_custom_fields_in_a_box - ProjectCustomField.find_by_name('Development status').update_attribute :visible, true + cf = ProjectCustomField.find_by_name('Development status') + cf.update_attribute :visible, true get :show, :params => { :id => 'ecookbook' } assert_response :success - assert_select '.box h3', :text => /Development status/ - assert_select '.custom', :text => /Stable/ + assert_select ".box h3.cf_#{cf.id}", :text => /#{cf.name}/ + assert_select '.custom.box', :text => /Stable/ end def test_show_should_not_display_blank_custom_fields_with_multiple_values