From e7d48427d6ff117c09859751e08e577ab0c1871d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 29 Nov 2011 20:56:33 +0000 Subject: [PATCH] Adds functional tests on issue list content formatting. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7991 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/issues_controller_test.rb | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 19f01554b..3a2ce90cc 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -596,6 +596,31 @@ class IssuesControllerTest < ActionController::TestCase :ancestor => {:tag => 'table', :attributes => {:class => /issues/}} end + def test_index_with_date_column + Issue.find(1).update_attribute :start_date, '1987-08-24' + + with_settings :date_format => '%d/%m/%Y' do + get :index, :set_filter => 1, :c => %w(start_date) + assert_tag 'td', :attributes => {:class => /start_date/}, :content => '24/08/1987' + end + end + + def test_index_with_done_ratio + Issue.find(1).update_attribute :done_ratio, 40 + + get :index, :set_filter => 1, :c => %w(done_ratio) + assert_tag 'td', :attributes => {:class => /done_ratio/}, + :child => {:tag => 'table', :attributes => {:class => 'progress'}, + :descendant => {:tag => 'td', :attributes => {:class => 'closed', :style => 'width: 40%;'}} + } + end + + def test_index_with_fixed_version + get :index, :set_filter => 1, :c => %w(fixed_version) + assert_tag 'td', :attributes => {:class => /fixed_version/}, + :child => {:tag => 'a', :content => '1.0', :attributes => {:href => '/versions/2'}} + end + def test_index_send_html_if_query_is_invalid get :index, :f => ['start_date'], :op => {:start_date => '='} assert_equal 'text/html', @response.content_type -- 2.39.5