remove trailing white-spaces from test/unit/lib/redmine/helpers/gantt_test.rb.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6788 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-08-30 07:53:59 +00:00
parent 5bf8d32503
commit 98e7d125f1

View File

@ -5,12 +5,12 @@
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. # of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@ -26,7 +26,7 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
include ApplicationHelper include ApplicationHelper
include ProjectsHelper include ProjectsHelper
include IssuesHelper include IssuesHelper
def self.default_url_options def self.default_url_options
{:only_path => true } {:only_path => true }
end end
@ -78,7 +78,7 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
5.times do 5.times do
Issue.generate_for_project!(p) Issue.generate_for_project!(p)
end end
create_gantt(p) create_gantt(p)
@gantt.render @gantt.render
assert_equal 6, @gantt.number_of_rows assert_equal 6, @gantt.number_of_rows
@ -109,7 +109,7 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
version = Version.generate! version = Version.generate!
@project.versions << version @project.versions << version
@project.issues << Issue.generate_for_project!(@project, :fixed_version => version) @project.issues << Issue.generate_for_project!(@project, :fixed_version => version)
assert_equal 3, @gantt.number_of_rows_on_project(@project) assert_equal 3, @gantt.number_of_rows_on_project(@project)
end end
end end
@ -131,56 +131,56 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
:done_ratio => 30, :done_ratio => 30,
:start_date => Date.yesterday, :start_date => Date.yesterday,
:due_date => 1.week.from_now.to_date) :due_date => 1.week.from_now.to_date)
@project.issues << @issue @project.issues << @issue
end end
context "project" do context "project" do
should "be rendered" do should "be rendered" do
@response.body = @gantt.subjects @response.body = @gantt.subjects
assert_select "div.project-name a", /#{@project.name}/ assert_select "div.project-name a", /#{@project.name}/
end end
should "have an indent of 4" do should "have an indent of 4" do
@response.body = @gantt.subjects @response.body = @gantt.subjects
assert_select "div.project-name[style*=left:4px]" assert_select "div.project-name[style*=left:4px]"
end end
end end
context "version" do context "version" do
should "be rendered" do should "be rendered" do
@response.body = @gantt.subjects @response.body = @gantt.subjects
assert_select "div.version-name a", /#{@version.name}/ assert_select "div.version-name a", /#{@version.name}/
end end
should "be indented 24 (one level)" do should "be indented 24 (one level)" do
@response.body = @gantt.subjects @response.body = @gantt.subjects
assert_select "div.version-name[style*=left:24px]" assert_select "div.version-name[style*=left:24px]"
end end
context "without assigned issues" do context "without assigned issues" do
setup do setup do
@version = Version.generate!(:effective_date => 2.week.from_now.to_date, :sharing => 'none', :name => 'empty_version') @version = Version.generate!(:effective_date => 2.week.from_now.to_date, :sharing => 'none', :name => 'empty_version')
@project.versions << @version @project.versions << @version
end end
should "not be rendered" do should "not be rendered" do
@response.body = @gantt.subjects @response.body = @gantt.subjects
assert_select "div.version-name a", :text => /#{@version.name}/, :count => 0 assert_select "div.version-name a", :text => /#{@version.name}/, :count => 0
end end
end end
end end
context "issue" do context "issue" do
should "be rendered" do should "be rendered" do
@response.body = @gantt.subjects @response.body = @gantt.subjects
assert_select "div.issue-subject", /#{@issue.subject}/ assert_select "div.issue-subject", /#{@issue.subject}/
end end
should "be indented 44 (two levels)" do should "be indented 44 (two levels)" do
@response.body = @gantt.subjects @response.body = @gantt.subjects
assert_select "div.issue-subject[style*=left:44px]" assert_select "div.issue-subject[style*=left:44px]"
end end
context "assigned to a shared version of another project" do context "assigned to a shared version of another project" do
setup do setup do
p = Project.generate! p = Project.generate!
@ -189,7 +189,7 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
@shared_version = Version.generate!(:sharing => 'system') @shared_version = Version.generate!(:sharing => 'system')
p.versions << @shared_version p.versions << @shared_version
# Reassign the issue to a shared version of another project # Reassign the issue to a shared version of another project
@issue = Issue.generate!(:fixed_version => @shared_version, @issue = Issue.generate!(:fixed_version => @shared_version,
:subject => "gantt#assigned_to_shared_version", :subject => "gantt#assigned_to_shared_version",
:tracker => @tracker, :tracker => @tracker,
@ -199,13 +199,13 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
:due_date => 1.week.from_now.to_date) :due_date => 1.week.from_now.to_date)
@project.issues << @issue @project.issues << @issue
end end
should "be rendered" do should "be rendered" do
@response.body = @gantt.subjects @response.body = @gantt.subjects
assert_select "div.issue-subject", /#{@issue.subject}/ assert_select "div.issue-subject", /#{@issue.subject}/
end end
end end
context "with subtasks" do context "with subtasks" do
setup do setup do
attrs = {:project => @project, :tracker => @tracker, :fixed_version => @version} attrs = {:project => @project, :tracker => @tracker, :fixed_version => @version}
@ -213,7 +213,7 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
@child2 = Issue.generate!(attrs.merge(:subject => 'child2', :parent_issue_id => @issue.id, :start_date => Date.today, :due_date => 1.week.from_now.to_date)) @child2 = Issue.generate!(attrs.merge(:subject => 'child2', :parent_issue_id => @issue.id, :start_date => Date.today, :due_date => 1.week.from_now.to_date))
@grandchild = Issue.generate!(attrs.merge(:subject => 'grandchild', :parent_issue_id => @child1.id, :start_date => Date.yesterday, :due_date => 2.day.from_now.to_date)) @grandchild = Issue.generate!(attrs.merge(:subject => 'grandchild', :parent_issue_id => @child1.id, :start_date => Date.yesterday, :due_date => 2.day.from_now.to_date))
end end
should "indent subtasks" do should "indent subtasks" do
@response.body = @gantt.subjects @response.body = @gantt.subjects
# parent task 44px # parent task 44px
@ -291,7 +291,7 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
setup do setup do
create_gantt create_gantt
end end
context ":html format" do context ":html format" do
should "add an absolute positioned div" do should "add an absolute positioned div" do
@response.body = @gantt.subject_for_project(@project, {:format => :html}) @response.body = @gantt.subject_for_project(@project, {:format => :html})
@ -416,7 +416,7 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
assert_select "div.project.ending[style*=left:88px]", true, @response.body assert_select "div.project.ending[style*=left:88px]", true, @response.body
end end
end end
context "status content" do context "status content" do
should "appear at the far left, even if it's far in the past" do should "appear at the far left, even if it's far in the past" do
@gantt.instance_variable_set('@date_to', 2.weeks.ago.to_date) @gantt.instance_variable_set('@date_to', 2.weeks.ago.to_date)
@ -583,7 +583,7 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
assert_select "div.version.ending[style*=left:88px]", true, @response.body assert_select "div.version.ending[style*=left:88px]", true, @response.body
end end
end end
context "status content" do context "status content" do
should "appear at the far left, even if it's far in the past" do should "appear at the far left, even if it's far in the past" do
@gantt.instance_variable_set('@date_to', 2.weeks.ago.to_date) @gantt.instance_variable_set('@date_to', 2.weeks.ago.to_date)
@ -715,12 +715,12 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
should "not be the total done width if the chart starts after issue start date" do should "not be the total done width if the chart starts after issue start date" do
create_gantt(@project, :date_from => 5.days.ago.to_date) create_gantt(@project, :date_from => 5.days.ago.to_date)
@response.body = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4}) @response.body = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4})
assert_select "div.task_done[style*=left:0px]", true, @response.body assert_select "div.task_done[style*=left:0px]", true, @response.body
assert_select "div.task_done[style*=width:8px]", true, @response.body assert_select "div.task_done[style*=width:8px]", true, @response.body
end end
context "for completed issue" do context "for completed issue" do
setup do setup do
@issue.done_ratio = 100 @issue.done_ratio = 100
@ -730,7 +730,7 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
@response.body = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4}) @response.body = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4})
assert_select "div.task_done[style*=width:58px]", true, @response.body assert_select "div.task_done[style*=width:58px]", true, @response.body
end end
should "be the total width of the issue with due_date=start_date" do should "be the total width of the issue with due_date=start_date" do
@issue.due_date = @issue.start_date @issue.due_date = @issue.start_date
@response.body = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4}) @response.body = @gantt.line_for_issue(@issue, {:format => :html, :zoom => 4})
@ -775,5 +775,5 @@ class Redmine::Helpers::GanttTest < ActiveSupport::TestCase
context "#to_pdf" do context "#to_pdf" do
should "be tested" should "be tested"
end end
end end