##// END OF EJS Templates
Merged r11509 and r11512 from trunk (#13309)....
Jean-Philippe Lang -
r11284:5bb2f5e211b7
parent child
Show More
@@ -954,7 +954,7 class Issue < ActiveRecord::Base
954 954
955 955 # Returns a string of css classes that apply to the issue
956 956 def css_classes
957 s = "issue status-#{status_id} #{priority.try(:css_classes)}"
957 s = "issue tracker-#{tracker_id} status-#{status_id} #{priority.try(:css_classes)}"
958 958 s << ' closed' if closed?
959 959 s << ' overdue' if overdue?
960 960 s << ' child' if child?
@@ -253,9 +253,9 RAW
253 253
254 254 def test_redmine_links
255 255 issue_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3},
256 :class => 'issue status-1 priority-4 priority-lowest overdue', :title => 'Error 281 when updating a recipe (New)')
256 :class => Issue.find(3).css_classes, :title => 'Error 281 when updating a recipe (New)')
257 257 note_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3, :anchor => 'note-14'},
258 :class => 'issue status-1 priority-4 priority-lowest overdue', :title => 'Error 281 when updating a recipe (New)')
258 :class => Issue.find(3).css_classes, :title => 'Error 281 when updating a recipe (New)')
259 259
260 260 changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1},
261 261 :class => 'changeset', :title => 'My very first commit')
@@ -745,7 +745,7 RAW
745 745
746 746 expected = <<-EXPECTED
747 747 <p><a href="/projects/ecookbook/wiki/CookBook_documentation" class="wiki-page">CookBook documentation</a></p>
748 <p><a href="/issues/1" class="issue status-1 priority-4 priority-lowest" title="Can&#x27;t print recipes (New)">#1</a></p>
748 <p><a href="/issues/1" class="#{Issue.find(1).css_classes}" title="Can&#x27;t print recipes (New)">#1</a></p>
749 749 <pre>
750 750 [[CookBook documentation]]
751 751
@@ -1910,6 +1910,12 class IssueTest < ActiveSupport::TestCase
1910 1910 assert_equal [Journal.find(1), Journal.find(2)], Issue.find(1).journals_after('')
1911 1911 end
1912 1912
1913 def test_css_classes_should_include_tracker
1914 issue = Issue.new(:tracker => Tracker.find(2))
1915 classes = issue.css_classes.split(' ')
1916 assert_include 'tracker-2', classes
1917 end
1918
1913 1919 def test_css_classes_should_include_priority
1914 1920 issue = Issue.new(:priority => IssuePriority.find(8))
1915 1921 classes = issue.css_classes.split(' ')
General Comments 0
You need to be logged in to leave comments. Login now