Commit d2e8b214200f519a63b0ec671471cfad761b30d4
Committed by
Rafael Manzo
1 parent
6d9d8926
Exists in
colab
and in
4 other branches
Starting acceptance tests for module result
Signed-off-by: Guilherme Rojas V. de Lima <guilhermehrojas@gmail.com> Signed-off-by: Diego Araujo <diegoamc90@gmail.com>
Showing
4 changed files
with
62 additions
and
2 deletions
Show diff stats
app/views/repositories/show.html.erb
... | ... | @@ -34,8 +34,13 @@ |
34 | 34 | </p> |
35 | 35 | <% end %> |
36 | 36 | <% end %> |
37 | - | |
38 | 37 | <hr/> |
38 | +<h2>Source Tree</h2> | |
39 | +<% if @processing.ready? %> | |
40 | + <h3><%= @module_result.module.name %></h3> | |
41 | + <li> | |
42 | + </li> | |
43 | +<% end %> | |
39 | 44 | |
40 | 45 | <% if @processing.ready? %> |
41 | 46 | <table class="table table-hover"> | ... | ... |
features/repository/show.feature
... | ... | @@ -43,4 +43,44 @@ Feature: Show Repository |
43 | 43 | And I should not see Metric |
44 | 44 | And I should not see Value |
45 | 45 | And I should not see Weight |
46 | - And I should not see Threshold | |
47 | 46 | \ No newline at end of file |
47 | + And I should not see Threshold | |
48 | + | |
49 | + @kalibro_restart | |
50 | + Scenario: Should show modules title | |
51 | + Given I am a regular user | |
52 | + And I am signed in | |
53 | + And I have a sample project | |
54 | + And I have a sample configuration with native metrics | |
55 | + And I have a sample repository within the sample project | |
56 | + And I start to process that repository | |
57 | + And I wait up for a ready processing | |
58 | + When I visit the repository show page | |
59 | + Then I should see "Source Tree" | |
60 | + | |
61 | + @kalibro_restart | |
62 | + Scenario: Should show modules directories root when the process has been finished | |
63 | + Given I am a regular user | |
64 | + And I am signed in | |
65 | + And I have a sample project | |
66 | + And I have a sample configuration with native metrics | |
67 | + And I have a sample repository within the sample project | |
68 | + And I start to process that repository | |
69 | + And I wait up for a ready processing | |
70 | + And I ask for the last ready processing of the given repository | |
71 | + And I ask for the module result of the given processing | |
72 | + When I visit the repository show page | |
73 | + Then I should see the given module result | |
74 | + | |
75 | + @kalibro_restart | |
76 | + Scenario: Should show childrens of root when the process has been finished | |
77 | + Given I am a regular user | |
78 | + And I am signed in | |
79 | + And I have a sample project | |
80 | + And I have a sample configuration with native metrics | |
81 | + And I have a sample repository within the sample project | |
82 | + And I start to process that repository | |
83 | + And I wait up for a ready processing | |
84 | + And I ask for the last ready processing of the given repository | |
85 | + And I ask for the module result of the given processing | |
86 | + When I visit the repository show page | |
87 | + Then I should see the given module result | |
48 | 88 | \ No newline at end of file | ... | ... |
features/step_definitions/repository_steps.rb
... | ... | @@ -39,6 +39,14 @@ Given(/^I am at repository edit page$/) do |
39 | 39 | visit edit_project_repository_path(@repository.project_id, @repository.id) |
40 | 40 | end |
41 | 41 | |
42 | +Given(/^I ask for the last ready processing of the given repository$/) do | |
43 | + @processing = Processing.last_ready_processing_of @repository.id | |
44 | +end | |
45 | + | |
46 | +Given(/^I ask for the module result of the given processing$/) do | |
47 | + @module_result = ModuleResult.find @processing.results_root_id | |
48 | +end | |
49 | + | |
42 | 50 | When(/^I set the select field "(.+)" as "(.+)"$/) do |field, text| |
43 | 51 | select text, from: field |
44 | 52 | end |
... | ... | @@ -54,3 +62,7 @@ end |
54 | 62 | Then(/^the field "(.*?)" should be filled with "(.*?)"$/) do |field, value| |
55 | 63 | page.find_field(field).value.should eq(value) |
56 | 64 | end |
65 | + | |
66 | +Then(/^I should see the given module result$/) do | |
67 | + page.should have_content(@module_result.module.name) | |
68 | +end | |
57 | 69 | \ No newline at end of file | ... | ... |