@@ -63,24 +63,24 class IssuesHelperTest < ActionView::TestCase | |||
|
63 | 63 | context "IssuesHelper#show_detail" do |
|
64 | 64 | context "with no_html" do |
|
65 | 65 | should 'show a changing attribute' do |
|
66 |
@detail = JournalDetail. |
|
|
66 | @detail = JournalDetail.new(:property => 'attr', :old_value => '40', :value => '100', :prop_key => 'done_ratio') | |
|
67 | 67 | assert_equal "% Done changed from 40 to 100", show_detail(@detail, true) |
|
68 | 68 | end |
|
69 | 69 | |
|
70 | 70 | should 'show a new attribute' do |
|
71 |
@detail = JournalDetail. |
|
|
71 | @detail = JournalDetail.new(:property => 'attr', :old_value => nil, :value => '100', :prop_key => 'done_ratio') | |
|
72 | 72 | assert_equal "% Done set to 100", show_detail(@detail, true) |
|
73 | 73 | end |
|
74 | 74 | |
|
75 | 75 | should 'show a deleted attribute' do |
|
76 |
@detail = JournalDetail. |
|
|
76 | @detail = JournalDetail.new(:property => 'attr', :old_value => '50', :value => nil, :prop_key => 'done_ratio') | |
|
77 | 77 | assert_equal "% Done deleted (50)", show_detail(@detail, true) |
|
78 | 78 | end |
|
79 | 79 | end |
|
80 | 80 | |
|
81 | 81 | context "with html" do |
|
82 | 82 | should 'show a changing attribute with HTML highlights' do |
|
83 |
@detail = JournalDetail. |
|
|
83 | @detail = JournalDetail.new(:property => 'attr', :old_value => '40', :value => '100', :prop_key => 'done_ratio') | |
|
84 | 84 | html = show_detail(@detail, false) |
|
85 | 85 | |
|
86 | 86 | assert_include '<strong>% Done</strong>', html |
@@ -89,7 +89,7 class IssuesHelperTest < ActionView::TestCase | |||
|
89 | 89 | end |
|
90 | 90 | |
|
91 | 91 | should 'show a new attribute with HTML highlights' do |
|
92 |
@detail = JournalDetail. |
|
|
92 | @detail = JournalDetail.new(:property => 'attr', :old_value => nil, :value => '100', :prop_key => 'done_ratio') | |
|
93 | 93 | html = show_detail(@detail, false) |
|
94 | 94 | |
|
95 | 95 | assert_include '<strong>% Done</strong>', html |
@@ -97,7 +97,7 class IssuesHelperTest < ActionView::TestCase | |||
|
97 | 97 | end |
|
98 | 98 | |
|
99 | 99 | should 'show a deleted attribute with HTML highlights' do |
|
100 |
@detail = JournalDetail. |
|
|
100 | @detail = JournalDetail.new(:property => 'attr', :old_value => '50', :value => nil, :prop_key => 'done_ratio') | |
|
101 | 101 | html = show_detail(@detail, false) |
|
102 | 102 | |
|
103 | 103 | assert_include '<strong>% Done</strong>', html |
@@ -107,24 +107,24 class IssuesHelperTest < ActionView::TestCase | |||
|
107 | 107 | |
|
108 | 108 | context "with a start_date attribute" do |
|
109 | 109 | should "format the current date" do |
|
110 |
@detail = JournalDetail. |
|
|
110 | @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'start_date') | |
|
111 | 111 | assert_match "01/31/2010", show_detail(@detail, true) |
|
112 | 112 | end |
|
113 | 113 | |
|
114 | 114 | should "format the old date" do |
|
115 |
@detail = JournalDetail. |
|
|
115 | @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'start_date') | |
|
116 | 116 | assert_match "01/01/2010", show_detail(@detail, true) |
|
117 | 117 | end |
|
118 | 118 | end |
|
119 | 119 | |
|
120 | 120 | context "with a due_date attribute" do |
|
121 | 121 | should "format the current date" do |
|
122 |
@detail = JournalDetail. |
|
|
122 | @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'due_date') | |
|
123 | 123 | assert_match "01/31/2010", show_detail(@detail, true) |
|
124 | 124 | end |
|
125 | 125 | |
|
126 | 126 | should "format the old date" do |
|
127 |
@detail = JournalDetail. |
|
|
127 | @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'due_date') | |
|
128 | 128 | assert_match "01/01/2010", show_detail(@detail, true) |
|
129 | 129 | end |
|
130 | 130 | end |
General Comments 0
You need to be logged in to leave comments.
Login now