@@ -954,7 +954,7 class Issue < ActiveRecord::Base | |||||
954 |
|
954 | |||
955 | # Returns a string of css classes that apply to the issue |
|
955 | # Returns a string of css classes that apply to the issue | |
956 | def css_classes |
|
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 | s << ' closed' if closed? |
|
958 | s << ' closed' if closed? | |
959 | s << ' overdue' if overdue? |
|
959 | s << ' overdue' if overdue? | |
960 | s << ' child' if child? |
|
960 | s << ' child' if child? |
@@ -253,9 +253,9 RAW | |||||
253 |
|
253 | |||
254 | def test_redmine_links |
|
254 | def test_redmine_links | |
255 | issue_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3}, |
|
255 | issue_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3}, | |
256 |
:class => |
|
256 | :class => Issue.find(3).css_classes, :title => 'Error 281 when updating a recipe (New)') | |
257 | note_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3, :anchor => 'note-14'}, |
|
257 | note_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3, :anchor => 'note-14'}, | |
258 |
:class => |
|
258 | :class => Issue.find(3).css_classes, :title => 'Error 281 when updating a recipe (New)') | |
259 |
|
259 | |||
260 | changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1}, |
|
260 | changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1}, | |
261 | :class => 'changeset', :title => 'My very first commit') |
|
261 | :class => 'changeset', :title => 'My very first commit') | |
@@ -745,7 +745,7 RAW | |||||
745 |
|
745 | |||
746 | expected = <<-EXPECTED |
|
746 | expected = <<-EXPECTED | |
747 | <p><a href="/projects/ecookbook/wiki/CookBook_documentation" class="wiki-page">CookBook documentation</a></p> |
|
747 | <p><a href="/projects/ecookbook/wiki/CookBook_documentation" class="wiki-page">CookBook documentation</a></p> | |
748 |
<p><a href="/issues/1" class=" |
|
748 | <p><a href="/issues/1" class="#{Issue.find(1).css_classes}" title="Can't print recipes (New)">#1</a></p> | |
749 | <pre> |
|
749 | <pre> | |
750 | [[CookBook documentation]] |
|
750 | [[CookBook documentation]] | |
751 |
|
751 |
@@ -1910,6 +1910,12 class IssueTest < ActiveSupport::TestCase | |||||
1910 | assert_equal [Journal.find(1), Journal.find(2)], Issue.find(1).journals_after('') |
|
1910 | assert_equal [Journal.find(1), Journal.find(2)], Issue.find(1).journals_after('') | |
1911 | end |
|
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 | def test_css_classes_should_include_priority |
|
1919 | def test_css_classes_should_include_priority | |
1914 | issue = Issue.new(:priority => IssuePriority.find(8)) |
|
1920 | issue = Issue.new(:priority => IssuePriority.find(8)) | |
1915 | classes = issue.css_classes.split(' ') |
|
1921 | classes = issue.css_classes.split(' ') |
General Comments 0
You need to be logged in to leave comments.
Login now