summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-03-04 12:03:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-03-04 12:03:59 +0000
commitbcd8c643844f14eabdb751aae4cdc050b3dcc4f2 (patch)
tree6adf0e0756b39b39bb656d5b343bd09238a89791
parentc30a6dffe05102b36e8549d3cc5ab183a5aadf28 (diff)
downloadredmine-bcd8c643844f14eabdb751aae4cdc050b3dcc4f2.tar.gz
redmine-bcd8c643844f14eabdb751aae4cdc050b3dcc4f2.zip
No need to save the record.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9077 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/unit/helpers/issues_helper_test.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/unit/helpers/issues_helper_test.rb b/test/unit/helpers/issues_helper_test.rb
index 0bf063bf0..ac0dc85d1 100644
--- a/test/unit/helpers/issues_helper_test.rb
+++ b/test/unit/helpers/issues_helper_test.rb
@@ -63,24 +63,24 @@ class IssuesHelperTest < ActionView::TestCase
context "IssuesHelper#show_detail" do
context "with no_html" do
should 'show a changing attribute' do
- @detail = JournalDetail.generate!(:property => 'attr', :old_value => '40', :value => '100', :prop_key => 'done_ratio')
+ @detail = JournalDetail.new(:property => 'attr', :old_value => '40', :value => '100', :prop_key => 'done_ratio')
assert_equal "% Done changed from 40 to 100", show_detail(@detail, true)
end
should 'show a new attribute' do
- @detail = JournalDetail.generate!(:property => 'attr', :old_value => nil, :value => '100', :prop_key => 'done_ratio')
+ @detail = JournalDetail.new(:property => 'attr', :old_value => nil, :value => '100', :prop_key => 'done_ratio')
assert_equal "% Done set to 100", show_detail(@detail, true)
end
should 'show a deleted attribute' do
- @detail = JournalDetail.generate!(:property => 'attr', :old_value => '50', :value => nil, :prop_key => 'done_ratio')
+ @detail = JournalDetail.new(:property => 'attr', :old_value => '50', :value => nil, :prop_key => 'done_ratio')
assert_equal "% Done deleted (50)", show_detail(@detail, true)
end
end
context "with html" do
should 'show a changing attribute with HTML highlights' do
- @detail = JournalDetail.generate!(:property => 'attr', :old_value => '40', :value => '100', :prop_key => 'done_ratio')
+ @detail = JournalDetail.new(:property => 'attr', :old_value => '40', :value => '100', :prop_key => 'done_ratio')
html = show_detail(@detail, false)
assert_include '<strong>% Done</strong>', html
@@ -89,7 +89,7 @@ class IssuesHelperTest < ActionView::TestCase
end
should 'show a new attribute with HTML highlights' do
- @detail = JournalDetail.generate!(:property => 'attr', :old_value => nil, :value => '100', :prop_key => 'done_ratio')
+ @detail = JournalDetail.new(:property => 'attr', :old_value => nil, :value => '100', :prop_key => 'done_ratio')
html = show_detail(@detail, false)
assert_include '<strong>% Done</strong>', html
@@ -97,7 +97,7 @@ class IssuesHelperTest < ActionView::TestCase
end
should 'show a deleted attribute with HTML highlights' do
- @detail = JournalDetail.generate!(:property => 'attr', :old_value => '50', :value => nil, :prop_key => 'done_ratio')
+ @detail = JournalDetail.new(:property => 'attr', :old_value => '50', :value => nil, :prop_key => 'done_ratio')
html = show_detail(@detail, false)
assert_include '<strong>% Done</strong>', html
@@ -107,24 +107,24 @@ class IssuesHelperTest < ActionView::TestCase
context "with a start_date attribute" do
should "format the current date" do
- @detail = JournalDetail.generate!(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'start_date')
+ @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'start_date')
assert_match "01/31/2010", show_detail(@detail, true)
end
should "format the old date" do
- @detail = JournalDetail.generate!(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'start_date')
+ @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'start_date')
assert_match "01/01/2010", show_detail(@detail, true)
end
end
context "with a due_date attribute" do
should "format the current date" do
- @detail = JournalDetail.generate!(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'due_date')
+ @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'due_date')
assert_match "01/31/2010", show_detail(@detail, true)
end
should "format the old date" do
- @detail = JournalDetail.generate!(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'due_date')
+ @detail = JournalDetail.new(:property => 'attr', :old_value => '2010-01-01', :value => '2010-01-31', :prop_key => 'due_date')
assert_match "01/01/2010", show_detail(@detail, true)
end
end