| 143 |
143 |
end
|
| 144 |
144 |
private :setup_subjects
|
| 145 |
145 |
|
| 146 |
|
# TODO: more of an integration test
|
| 147 |
|
test "#subjects project should be rendered" do
|
| 148 |
|
setup_subjects
|
| 149 |
|
@output_buffer = @gantt.subjects
|
| 150 |
|
assert_select "div.gantt-row[data-gantt-row-type=project] a", /#{@project.name}/
|
| 151 |
|
assert_select 'div.gantt-row[data-gantt-row-type=project][style*="--gantt-row-indent:4px"]'
|
|
146 |
test "#subjects should render project rows with expanders" do
|
|
147 |
create_gantt
|
|
148 |
|
|
149 |
# A parent with only subprojects and no issues or versions of its own.
|
|
150 |
parent_project = @project
|
|
151 |
|
|
152 |
# A project with an issue that is not assigned to a version.
|
|
153 |
issue_project = Project.generate_with_parent!(parent_project)
|
|
154 |
Issue.generate!(:project => issue_project, :fixed_version => nil)
|
|
155 |
|
|
156 |
# A project with an issue assigned to its own version.
|
|
157 |
version_project = Project.generate_with_parent!(parent_project)
|
|
158 |
version = Version.generate!(:project => version_project)
|
|
159 |
Issue.generate!(:project => version_project, :fixed_version => version)
|
|
160 |
|
|
161 |
subjects = @gantt.subjects
|
|
162 |
[issue_project, version_project, parent_project].each do |project|
|
|
163 |
assert_select_in subjects, "div.gantt-row[data-gantt-row-key='project-#{project.id}']" do
|
|
164 |
assert_select 'a[href=?]', "/projects/#{project.identifier}", :text => project.name
|
|
165 |
assert_select '.expander', 1
|
|
166 |
end
|
|
167 |
end
|
|
168 |
assert_select_in subjects, 'div.gantt-row[data-gantt-row-type=project][style*="--gantt-row-indent:4px"]'
|
| 152 |
169 |
end
|
| 153 |
170 |
|
| 154 |
171 |
test "#subjects version should be rendered" do
|