@@ -642,10 +642,10 module Redmine | |||
|
642 | 642 | end |
|
643 | 643 | |
|
644 | 644 | if progress |
|
645 | progress_date = start_date + (end_date - start_date) * (progress / 100.0) | |
|
645 | progress_date = start_date + (end_date - start_date + 1) * (progress / 100.0) | |
|
646 | 646 | if progress_date > self.date_from && progress_date > start_date |
|
647 | 647 | if progress_date < self.date_to |
|
648 |
coords[:bar_progress_end] = progress_date - self.date_from |
|
|
648 | coords[:bar_progress_end] = progress_date - self.date_from | |
|
649 | 649 | else |
|
650 | 650 | coords[:bar_progress_end] = self.date_to - self.date_from + 1 |
|
651 | 651 | end |
@@ -537,9 +537,9 class Redmine::Helpers::GanttTest < ActiveSupport::TestCase | |||
|
537 | 537 | assert_select "div.version.task_done[style*=left:28px]", true, @response.body |
|
538 | 538 | end |
|
539 | 539 | |
|
540 |
should " |
|
|
540 | should "be the total done width of the version" do | |
|
541 | 541 | @response.body = @gantt.line_for_version(@version, {:format => :html, :zoom => 4}) |
|
542 |
assert_select "div.version.task_done[style*=width:1 |
|
|
542 | assert_select "div.version.task_done[style*=width:16px]", true, @response.body | |
|
543 | 543 | end |
|
544 | 544 | end |
|
545 | 545 | |
@@ -697,9 +697,10 class Redmine::Helpers::GanttTest < ActiveSupport::TestCase | |||
|
697 | 697 | assert_select "div.task_done[style*=left:28px]", true, @response.body |
|
698 | 698 | end |
|
699 | 699 | |
|
700 |
should " |
|
|
700 | should "be the total done width of the issue" do | |
|
701 | 701 | @response.body = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4}) |
|
702 | assert_select "div.task_done[style*=width:18px]", true, @response.body | |
|
702 | # 15 days * 4 px * 30% - 2 px for borders = 16 px | |
|
703 | assert_select "div.task_done[style*=width:16px]", true, @response.body | |
|
703 | 704 | end |
|
704 | 705 | |
|
705 | 706 | should "not be the total done width if the chart starts after issue start date" do |
@@ -707,7 +708,24 class Redmine::Helpers::GanttTest < ActiveSupport::TestCase | |||
|
707 | 708 | |
|
708 | 709 | @response.body = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4}) |
|
709 | 710 | assert_select "div.task_done[style*=left:0px]", true, @response.body |
|
710 |
assert_select "div.task_done[style*=width: |
|
|
711 | assert_select "div.task_done[style*=width:8px]", true, @response.body | |
|
712 | end | |
|
713 | ||
|
714 | context "for completed issue" do | |
|
715 | setup do | |
|
716 | @issue.done_ratio = 100 | |
|
717 | end | |
|
718 | ||
|
719 | should "be the total width of the issue" do | |
|
720 | @response.body = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4}) | |
|
721 | assert_select "div.task_done[style*=width:58px]", true, @response.body | |
|
722 | end | |
|
723 | ||
|
724 | should "be the total width of the issue with due_date=start_date" do | |
|
725 | @issue.due_date = @issue.start_date | |
|
726 | @response.body = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4}) | |
|
727 | assert_select "div.task_done[style*=width:2px]", true, @response.body | |
|
728 | end | |
|
711 | 729 | end |
|
712 | 730 | end |
|
713 | 731 |
General Comments 0
You need to be logged in to leave comments.
Login now