summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-12-17 13:40:25 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-12-17 13:40:25 +0000
commit98c7c179ca3fb614ba4544f1199eaaaae56c6524 (patch)
tree0b806d11172336740096ec38bb3bf9f9b9e938cb /test/unit
parent8f7da03419071e132bbda1c1983707de15350597 (diff)
downloadredmine-98c7c179ca3fb614ba4544f1199eaaaae56c6524.tar.gz
redmine-98c7c179ca3fb614ba4544f1199eaaaae56c6524.zip
Gantt code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4522 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/lib/redmine/helpers/gantt_test.rb36
1 files changed, 18 insertions, 18 deletions
diff --git a/test/unit/lib/redmine/helpers/gantt_test.rb b/test/unit/lib/redmine/helpers/gantt_test.rb
index 9578b6b43..5c665a952 100644
--- a/test/unit/lib/redmine/helpers/gantt_test.rb
+++ b/test/unit/lib/redmine/helpers/gantt_test.rb
@@ -225,10 +225,10 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
context "version" do
should "be rendered" do
- assert_select "div.milestone_todo"
- assert_select "div.milestone.starting"
- assert_select "div.milestone.ending"
- assert_select "div.label.version-name", /#{@version.name}/
+ assert_select "div.version.task_todo"
+ assert_select "div.version.starting"
+ assert_select "div.version.ending"
+ assert_select "div.label.version", /#{@version.name}/
end
end
@@ -477,7 +477,7 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
:tracker => @tracker,
:project => @project,
:done_ratio => 30,
- :start_date => Date.yesterday,
+ :start_date => 1.week.ago.to_date,
:due_date => 1.week.from_now.to_date)
end
@@ -485,12 +485,12 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
context "todo line" do
should "start from the starting point on the left" do
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.milestone_todo[style*=left:52px]"
+ assert_select "div.version.task_todo[style*=left:28px]", true, @response.body
end
should "be the total width of the version" do
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.milestone_todo[style*=width:31px]"
+ assert_select "div.version.task_todo[style*=width:58px]", true, @response.body
end
end
@@ -498,24 +498,24 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
context "late line" do
should "start from the starting point on the left" do
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.milestone_late[style*=left:52px]"
+ assert_select "div.version.task_late[style*=left:28px]", true, @response.body
end
should "be the total delayed width of the version" do
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.milestone_late[style*=width:6px]"
+ assert_select "div.version.task_late[style*=width:30px]", true, @response.body
end
end
context "done line" do
should "start from the starting point on the left" do
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.milestone_done[style*=left:52px]"
+ assert_select "div.version.task_done[style*=left:28px]", true, @response.body
end
should "Be the total done width of the version" do
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.milestone_done[style*=left:52px]"
+ assert_select "div.version.task_done[style*=width:18px]", true, @response.body
end
end
@@ -525,12 +525,12 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
@gantt.instance_variable_set('@date_from', Date.today)
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.milestone.starting", false
+ assert_select "div.version.starting", false
end
should "appear at the starting point" do
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.milestone.starting[style*=left:52px]"
+ assert_select "div.version.starting[style*=left:28px]", true, @response.body
end
end
@@ -540,13 +540,13 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
@gantt.instance_variable_set('@date_to', 2.weeks.ago.to_date)
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.milestone.ending", false
+ assert_select "div.version.ending", false
end
should "appear at the end of the date range" do
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.milestone.ending[style*=left:84px]"
+ assert_select "div.version.ending[style*=left:84px]", true, @response.body
end
end
@@ -555,17 +555,17 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
@gantt.instance_variable_set('@date_to', 2.weeks.ago.to_date)
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.version-name", /#{@version.name}/
+ assert_select "div.version.label", /#{@version.name}/
end
should "show the version name" do
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.version-name", /#{@version.name}/
+ assert_select "div.version.label", /#{@version.name}/
end
should "show the percent complete" do
@response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4})
- assert_select "div.version-name", /30%/
+ assert_select "div.version.label", /30%/
end
end
end