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 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 5 </tr>
5 6 \ No newline at end of file
... ...
app/views/repositories/show.html.erb
... ... @@ -38,13 +38,20 @@
38 38 <% if @processing.ready? %>
39 39 <h2>Source Tree</h2>
40 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 50 <tbody>
43   -
  51 + <%= render partial: 'module_result', collection: children %>
44 52 </tbody>
45   -
46   -
47 53 </table>
  54 + <% end %>
48 55 <% end %>
49 56  
50 57 <% if @processing.ready? %>
... ...
features/repository/show.feature
... ... @@ -3,7 +3,7 @@ Feature: Show Repository
3 3 As a regular user
4 4 I should see it's informations
5 5  
6   - @kalibro_restart
  6 + @kalibro_restart
7 7 Scenario: With a ready processing
8 8 Given I am a regular user
9 9 And I am signed in
... ... @@ -26,7 +26,7 @@ Feature: Show Repository
26 26 And I should see "Weight"
27 27 And I should see "Threshold"
28 28  
29   - @kalibro_restart @wip
  29 + @kalibro_restart
30 30 Scenario: Just after start to process
31 31 Given I am a regular user
32 32 And I am signed in
... ... @@ -45,19 +45,7 @@ Feature: Show Repository
45 45 And I should not see Weight
46 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 49 Scenario: Should show modules directories root when the process has been finished
62 50 Given I am a regular user
63 51 And I am signed in
... ... @@ -71,8 +59,8 @@ Feature: Show Repository
71 59 When I visit the repository show page
72 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 64 Given I am a regular user
77 65 And I am signed in
78 66 And I have a sample project
... ... @@ -83,4 +71,7 @@ Feature: Show Repository
83 71 And I ask for the last ready processing of the given repository
84 72 And I ask for the module result of the given processing
85 73 When I visit the repository show page
86   - Then I should see the given module result
87 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 79 \ No newline at end of file
... ...
features/step_definitions/repository_steps.rb
... ... @@ -65,4 +65,8 @@ end
65 65  
66 66 Then(/^I should see the given module result$/) do
67 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 72 end
69 73 \ No newline at end of file
... ...