mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
Adds assertions for import result.
git-svn-id: http://svn.redmine.org/redmine/trunk@15497 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
85097a89a1
commit
712d08a5d3
@ -3,7 +3,7 @@
|
|||||||
<% if @import.saved_items.count > 0 %>
|
<% if @import.saved_items.count > 0 %>
|
||||||
<p><%= l(:notice_import_finished, :count => @import.saved_items.count) %></p>
|
<p><%= l(:notice_import_finished, :count => @import.saved_items.count) %></p>
|
||||||
|
|
||||||
<ul>
|
<ul id="saved-items">
|
||||||
<% @import.saved_objects.each do |issue| %>
|
<% @import.saved_objects.each do |issue| %>
|
||||||
<li><%= link_to_issue issue %></li>
|
<li><%= link_to_issue issue %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
@ -14,16 +14,20 @@
|
|||||||
<p><%= l(:notice_import_finished_with_errors, :count => @import.unsaved_items.count, :total => @import.total_items) %></p>
|
<p><%= l(:notice_import_finished_with_errors, :count => @import.unsaved_items.count, :total => @import.total_items) %></p>
|
||||||
|
|
||||||
<table id="unsaved-items" class="list">
|
<table id="unsaved-items" class="list">
|
||||||
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Position</th>
|
<th>Position</th>
|
||||||
<th>Message</th>
|
<th>Message</th>
|
||||||
</tr>
|
</tr>
|
||||||
<% @import.unsaved_items.each do |item| %>
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% @import.unsaved_items.each do |item| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= item.position %></td>
|
<td><%= item.position %></td>
|
||||||
<td><%= simple_format_without_paragraph item.message %></td>
|
<td><%= simple_format_without_paragraph item.message %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@ -184,6 +184,8 @@ class ImportsControllerTest < ActionController::TestCase
|
|||||||
get :show, :id => import.to_param
|
get :show, :id => import.to_param
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'show'
|
assert_template 'show'
|
||||||
|
assert_select 'ul#saved-items'
|
||||||
|
assert_select 'ul#saved-items li', import.saved_items.count
|
||||||
assert_select 'table#unsaved-items', 0
|
assert_select 'table#unsaved-items', 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -197,5 +199,6 @@ class ImportsControllerTest < ActionController::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'show'
|
assert_template 'show'
|
||||||
assert_select 'table#unsaved-items'
|
assert_select 'table#unsaved-items'
|
||||||
|
assert_select 'table#unsaved-items tbody tr', import.unsaved_items.count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user