Commit 979850b129d2474f192430403b2cd75cb962b9a2

Authored by Diego Camarinha
1 parent 057737c7

Fix parent module navigation when on root module

  * Closes Issue #218

KalibroClient returns 0 instead of nil when the module has no parent.

Signed-off-by: Eduardo Silva Araújo <duduktamg@hotmail.com>
app/views/modules/_module_tree.html.erb
... ... @@ -10,7 +10,8 @@
10 10 <strong><%= KalibroModule.human_attribute_name('grade') %>:</strong>
11 11 <%= format_grade(@root_module_result.grade) %>
12 12 </p>
13   -<% unless @root_module_result.parent_id.nil? %>
  13 +
  14 +<% unless @root_module_result.parent_id == 0 %>
14 15 <p id="parent"><i class="icon-arrow-up"></i><%= link_to '../', '#parent', onClick: "Module.Tree.load('#{escape_javascript(image_tag 'loader.gif')} #{escape_javascript(t('loading_data'))}', #{@root_module_result.parent_id});" %></p>
15 16 <% end %>
16 17  
... ...
features/repository/show/modules_tree.feature
... ... @@ -17,6 +17,7 @@ Feature: Repository modules tree
17 17 When I visit the repository show page
18 18 And I click the "Modules Tree" h3
19 19 Then I should see the given module result
  20 + And I should not see "../"
20 21  
21 22 @kalibro_configuration_restart @kalibro_processor_restart @javascript
22 23 Scenario: Should show children of root when the process has been finished
... ...