From bcd8c643844f14eabdb751aae4cdc050b3dcc4f2 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 4 Mar 2012 12:03:59 +0000 Subject: [PATCH] No need to save the record. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9077 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/helpers/issues_helper_test.rb | 20 ++++++++++---------- 1 file 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 '% Done', 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 '% Done', 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 '% Done', 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