Commit f9c80895e97465d9b8f6976d97d8863ce864907f

Authored by Parley
Committed by Gust
1 parent 7bc653a4

verify_tests: Add command to mpog_step and fix create institution tests.

Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Signed-off-by: Parley Martins <parley@outlook.com>
features/institution_registration.feature
@@ -13,11 +13,14 @@ Feature: Institution Field @@ -13,11 +13,14 @@ Feature: Institution Field
13 And Institutions has initial default values on database 13 And Institutions has initial default values on database
14 14
15 @selenium 15 @selenium
16 - Scenario: Show new institution field when follow add new institution 16 + Scenario: Show new institution fields when clicked in create new institution
17 Given I go to /account/signup 17 Given I go to /account/signup
18 - When I follow "Add new institution" 18 + When I follow "Create new institution"
19 And I should see "New Institution" 19 And I should see "New Institution"
20 And I should see "Name" 20 And I should see "Name"
  21 + And I should see "State"
  22 + And I should see "City"
  23 + And I should see "Country"
21 And I should see "CNPJ" 24 And I should see "CNPJ"
22 And I should see "Public Institution" 25 And I should see "Public Institution"
23 And I choose "Public Institution" 26 And I choose "Public Institution"
@@ -28,9 +31,12 @@ Feature: Institution Field @@ -28,9 +31,12 @@ Feature: Institution Field
28 @selenium 31 @selenium
29 Scenario: Show new institution fields when private institution is selected 32 Scenario: Show new institution fields when private institution is selected
30 Given I go to /account/signup 33 Given I go to /account/signup
31 - When I follow "Add new institution" 34 + When I follow "Create new institution"
32 And I should see "New Institution" 35 And I should see "New Institution"
33 And I should see "Name" 36 And I should see "Name"
  37 + And I should see "State"
  38 + And I should see "City"
  39 + And I should see "Country"
34 And I should see "CNPJ" 40 And I should see "CNPJ"
35 And I should see "Private Institution" 41 And I should see "Private Institution"
36 And I choose "Private Institution" 42 And I choose "Private Institution"
@@ -39,33 +45,41 @@ Feature: Institution Field @@ -39,33 +45,41 @@ Feature: Institution Field
39 @selenium 45 @selenium
40 Scenario: Create new public institution when all required fields are filled. 46 Scenario: Create new public institution when all required fields are filled.
41 Given I go to /account/signup 47 Given I go to /account/signup
42 - When I follow "Add new institution" 48 + When I follow "Create new institution"
43 And I fill in "community_name" with "Institution Name" 49 And I fill in "community_name" with "Institution Name"
44 And I fill in "institutions_cnpj" with "00.000.000/0001-00" 50 And I fill in "institutions_cnpj" with "00.000.000/0001-00"
  51 + And I select "Brazil" from "community_country"
  52 + And I fill in "community_state" with "DF"
  53 + And I fill in "community_city" with "Brasilia"
45 And I choose "Public Institution" 54 And I choose "Public Institution"
46 - And I fill in "institutions_acronym" with "Teste"  
47 And I select "Executivo" from "institutions_governmental_power" 55 And I select "Executivo" from "institutions_governmental_power"
48 And I select "Federal" from "institutions_governmental_sphere" 56 And I select "Federal" from "institutions_governmental_sphere"
  57 + And I select "Autarquia" from "institutions_juridical_nature"
49 And I follow "Save" 58 And I follow "Save"
50 Then I should see "Institution Name" 59 Then I should see "Institution Name"
51 60
52 @selenium 61 @selenium
53 Scenario: Create new private institution when all required fields are filled 62 Scenario: Create new private institution when all required fields are filled
54 Given I go to /account/signup 63 Given I go to /account/signup
55 - When I follow "Add new institution" 64 + When I follow "Create new institution"
56 And I fill in "community_name" with "Institution Name" 65 And I fill in "community_name" with "Institution Name"
57 And I fill in "institutions_cnpj" with "00.000.000/0001-00" 66 And I fill in "institutions_cnpj" with "00.000.000/0001-00"
  67 + And I select "Brazil" from "community_country"
  68 + And I fill in "community_state" with "DF"
  69 + And I fill in "community_city" with "Brasilia"
58 And I choose "Private Institution" 70 And I choose "Private Institution"
59 - And I fill in "institutions_acronym" with "Teste"  
60 And I follow "Save" 71 And I follow "Save"
61 Then I should see "Institution Name" 72 Then I should see "Institution Name"
62 73
63 @selenium 74 @selenium
64 Scenario: Don't create an institution when name and cpnj are not filled 75 Scenario: Don't create an institution when name and cpnj are not filled
65 Given I go to /account/signup 76 Given I go to /account/signup
66 - When I follow "Add new institution" 77 + When I follow "Create new institution"
67 And I choose "Private Institution" 78 And I choose "Private Institution"
68 And I fill in "institutions_acronym" with "Teste" 79 And I fill in "institutions_acronym" with "Teste"
  80 + And I select "Brazil" from "community_country"
  81 + And I fill in "community_state" with "DF"
  82 + And I fill in "community_city" with "Brasilia"
69 And I follow "Save" 83 And I follow "Save"
70 Then I should see "Institution could not be created!" 84 Then I should see "Institution could not be created!"
71 And I should see "Name can't be blank" 85 And I should see "Name can't be blank"
@@ -74,20 +88,30 @@ Feature: Institution Field @@ -74,20 +88,30 @@ Feature: Institution Field
74 @selenium 88 @selenium
75 Scenario: Don't Create new institution when a governamental field is not filled 89 Scenario: Don't Create new institution when a governamental field is not filled
76 Given I go to /account/signup 90 Given I go to /account/signup
77 - When I follow "Add new institution" 91 + When I follow "Create new institution"
78 And I fill in "community_name" with "Institution Name" 92 And I fill in "community_name" with "Institution Name"
79 And I fill in "institutions_cnpj" with "00.000.000/0001-00" 93 And I fill in "institutions_cnpj" with "00.000.000/0001-00"
  94 + And I select "Brazil" from "community_country"
  95 + And I fill in "community_state" with "DF"
  96 + And I fill in "community_city" with "Brasilia"
80 And I choose "Public Institution" 97 And I choose "Public Institution"
81 And I follow "Save" 98 And I follow "Save"
82 - Then I should see "Governmental fields Could not find Governmental Power or Governmental Sphere" 99 + Then I should see "Governmental power can't be blank"
  100 + And I should see "Governmental sphere can't be blank"
  101 + And I should see "Juridical nature can't be blank"
83 102
84 @selenium 103 @selenium
85 - Scenario: Don't Create new institution when a governamental field is not filled 104 + Scenario: Don't Create new institution when no field is filled
86 Given I go to /account/signup 105 Given I go to /account/signup
87 - When I follow "Add new institution" 106 + When I follow "Create new institution"
88 And I choose "Public Institution" 107 And I choose "Public Institution"
89 And I follow "Save" 108 And I follow "Save"
90 Then I should see "Institution could not be created!" 109 Then I should see "Institution could not be created!"
91 - And I should see "Governmental fields Could not find Governmental Power or Governmental Sphere"  
92 And I should see "Name can't be blank" 110 And I should see "Name can't be blank"
  111 + And I should see "Country can't be blank"
  112 + And I should see "State can't be blank"
  113 + And I should see "City can't be blank"
  114 + And I should see "Governmental power can't be blank"
  115 + And I should see "Governmental sphere can't be blank"
  116 + And I should see "Juridical nature can't be blank"
93 And I should see "CNPJ can't be blank" 117 And I should see "CNPJ can't be blank"
features/step_definitions/mpog_steps.rb
@@ -24,6 +24,7 @@ Given /^Institutions has initial default values on database$/ do @@ -24,6 +24,7 @@ Given /^Institutions has initial default values on database$/ do
24 GovernmentalPower.create(:name => "Judiciario") 24 GovernmentalPower.create(:name => "Judiciario")
25 25
26 GovernmentalSphere.create(:name => "Federal") 26 GovernmentalSphere.create(:name => "Federal")
  27 + JuridicalNature.create(:name=> "Autarquia")
27 end 28 end
28 29
29 Given /^I type in "([^"]*)" into autocomplete list "([^"]*)" and I choose "([^"]*)"$/ do |typed, input_institution, should_select| 30 Given /^I type in "([^"]*)" into autocomplete list "([^"]*)" and I choose "([^"]*)"$/ do |typed, input_institution, should_select|