Commit 649789d224058a6fecd169e762a0451608d5dd1d

Authored by fllsouto
Committed by Rafael Manzo
1 parent b5c45d26

Acceptance test for show.feature and added new step to repository_step

And show children functionality edited

Signed-off-By: Renan Fichberg <rfichberg@gmail.com>
app/views/repositories/_module_result.html.erb
1 <tr> 1 <tr>
2 - <td><%= %></td>  
3 - <td><%= metric_result.module.name %></td> 2 + <td><%= module_result.module.name %></td>
  3 + <td><%= module_result.module.granularity %></td>
  4 + <td><%= module_result.grade %></td>
4 </tr> 5 </tr>
5 \ No newline at end of file 6 \ No newline at end of file
app/views/repositories/show.html.erb
@@ -38,13 +38,20 @@ @@ -38,13 +38,20 @@
38 <% if @processing.ready? %> 38 <% if @processing.ready? %>
39 <h2>Source Tree</h2> 39 <h2>Source Tree</h2>
40 <h3><%= @module_results.module.name %></h3> 40 <h3><%= @module_results.module.name %></h3>
41 - <table class="table table-hover"> 41 + <h3><%= @module_results.grade %> </h3>
  42 + <% children = @module_results.children %>
  43 + <% unless children.empty? %>
  44 + <table class="table table-hover">
  45 + <thead>
  46 + <th>Name</th>
  47 + <th>Granularity</th>
  48 + <th>Grade</th>
  49 + </thead>
42 <tbody> 50 <tbody>
43 - 51 + <%= render partial: 'module_result', collection: children %>
44 </tbody> 52 </tbody>
45 -  
46 -  
47 </table> 53 </table>
  54 + <% end %>
48 <% end %> 55 <% end %>
49 56
50 <% if @processing.ready? %> 57 <% if @processing.ready? %>
features/repository/show.feature
@@ -3,7 +3,7 @@ Feature: Show Repository @@ -3,7 +3,7 @@ Feature: Show Repository
3 As a regular user 3 As a regular user
4 I should see it's informations 4 I should see it's informations
5 5
6 - @kalibro_restart 6 + @kalibro_restart
7 Scenario: With a ready processing 7 Scenario: With a ready processing
8 Given I am a regular user 8 Given I am a regular user
9 And I am signed in 9 And I am signed in
@@ -26,7 +26,7 @@ Feature: Show Repository @@ -26,7 +26,7 @@ Feature: Show Repository
26 And I should see "Weight" 26 And I should see "Weight"
27 And I should see "Threshold" 27 And I should see "Threshold"
28 28
29 - @kalibro_restart @wip 29 + @kalibro_restart
30 Scenario: Just after start to process 30 Scenario: Just after start to process
31 Given I am a regular user 31 Given I am a regular user
32 And I am signed in 32 And I am signed in
@@ -45,19 +45,7 @@ Feature: Show Repository @@ -45,19 +45,7 @@ Feature: Show Repository
45 And I should not see Weight 45 And I should not see Weight
46 And I should not see Threshold 46 And I should not see Threshold
47 47
48 - @kalibro_restart @wip  
49 - Scenario: Should show modules title  
50 - Given I am a regular user  
51 - And I am signed in  
52 - And I have a sample project  
53 - And I have a sample configuration with native metrics  
54 - And I have a sample repository within the sample project  
55 - And I start to process that repository  
56 - And I wait up for a ready processing  
57 - When I visit the repository show page  
58 - Then I should see "Source Tree"  
59 -  
60 - @kalibro_restart @wip 48 + @kalibro_restart
61 Scenario: Should show modules directories root when the process has been finished 49 Scenario: Should show modules directories root when the process has been finished
62 Given I am a regular user 50 Given I am a regular user
63 And I am signed in 51 And I am signed in
@@ -71,8 +59,8 @@ Feature: Show Repository @@ -71,8 +59,8 @@ Feature: Show Repository
71 When I visit the repository show page 59 When I visit the repository show page
72 Then I should see the given module result 60 Then I should see the given module result
73 61
74 - @kalibro_restart @wip  
75 - Scenario: Should show childrens of root when the process has been finished 62 + @kalibro_restart
  63 + Scenario: Should show children of root when the process has been finished
76 Given I am a regular user 64 Given I am a regular user
77 And I am signed in 65 And I am signed in
78 And I have a sample project 66 And I have a sample project
@@ -83,4 +71,7 @@ Feature: Show Repository @@ -83,4 +71,7 @@ Feature: Show Repository
83 And I ask for the last ready processing of the given repository 71 And I ask for the last ready processing of the given repository
84 And I ask for the module result of the given processing 72 And I ask for the module result of the given processing
85 When I visit the repository show page 73 When I visit the repository show page
86 - Then I should see the given module result  
87 \ No newline at end of file 74 \ No newline at end of file
  75 + Then I should see a sample child's name
  76 + And I should see "Name"
  77 + And I should see "Granularity"
  78 + And I should see "Grade"
88 \ No newline at end of file 79 \ No newline at end of file
features/step_definitions/repository_steps.rb
@@ -65,4 +65,8 @@ end @@ -65,4 +65,8 @@ end
65 65
66 Then(/^I should see the given module result$/) do 66 Then(/^I should see the given module result$/) do
67 page.should have_content(@module_result.module.name) 67 page.should have_content(@module_result.module.name)
  68 +end
  69 +
  70 +Then(/^I should see a sample child's name$/) do
  71 + page.should have_content(@module_result.children.first.module.name)
68 end 72 end
69 \ No newline at end of file 73 \ No newline at end of file