diff --git a/features/institution_registration.feature b/features/institution_registration.feature index 3916739..727f0c4 100644 --- a/features/institution_registration.feature +++ b/features/institution_registration.feature @@ -13,11 +13,14 @@ Feature: Institution Field And Institutions has initial default values on database @selenium - Scenario: Show new institution field when follow add new institution + Scenario: Show new institution fields when clicked in create new institution Given I go to /account/signup - When I follow "Add new institution" + When I follow "Create new institution" And I should see "New Institution" And I should see "Name" + And I should see "State" + And I should see "City" + And I should see "Country" And I should see "CNPJ" And I should see "Public Institution" And I choose "Public Institution" @@ -28,9 +31,12 @@ Feature: Institution Field @selenium Scenario: Show new institution fields when private institution is selected Given I go to /account/signup - When I follow "Add new institution" + When I follow "Create new institution" And I should see "New Institution" And I should see "Name" + And I should see "State" + And I should see "City" + And I should see "Country" And I should see "CNPJ" And I should see "Private Institution" And I choose "Private Institution" @@ -39,33 +45,41 @@ Feature: Institution Field @selenium Scenario: Create new public institution when all required fields are filled. Given I go to /account/signup - When I follow "Add new institution" + When I follow "Create new institution" And I fill in "community_name" with "Institution Name" And I fill in "institutions_cnpj" with "00.000.000/0001-00" + And I select "Brazil" from "community_country" + And I fill in "community_state" with "DF" + And I fill in "community_city" with "Brasilia" And I choose "Public Institution" - And I fill in "institutions_acronym" with "Teste" And I select "Executivo" from "institutions_governmental_power" And I select "Federal" from "institutions_governmental_sphere" + And I select "Autarquia" from "institutions_juridical_nature" And I follow "Save" Then I should see "Institution Name" @selenium Scenario: Create new private institution when all required fields are filled Given I go to /account/signup - When I follow "Add new institution" + When I follow "Create new institution" And I fill in "community_name" with "Institution Name" And I fill in "institutions_cnpj" with "00.000.000/0001-00" + And I select "Brazil" from "community_country" + And I fill in "community_state" with "DF" + And I fill in "community_city" with "Brasilia" And I choose "Private Institution" - And I fill in "institutions_acronym" with "Teste" And I follow "Save" Then I should see "Institution Name" @selenium Scenario: Don't create an institution when name and cpnj are not filled Given I go to /account/signup - When I follow "Add new institution" + When I follow "Create new institution" And I choose "Private Institution" And I fill in "institutions_acronym" with "Teste" + And I select "Brazil" from "community_country" + And I fill in "community_state" with "DF" + And I fill in "community_city" with "Brasilia" And I follow "Save" Then I should see "Institution could not be created!" And I should see "Name can't be blank" @@ -74,20 +88,30 @@ Feature: Institution Field @selenium Scenario: Don't Create new institution when a governamental field is not filled Given I go to /account/signup - When I follow "Add new institution" + When I follow "Create new institution" And I fill in "community_name" with "Institution Name" And I fill in "institutions_cnpj" with "00.000.000/0001-00" + And I select "Brazil" from "community_country" + And I fill in "community_state" with "DF" + And I fill in "community_city" with "Brasilia" And I choose "Public Institution" And I follow "Save" - Then I should see "Governmental fields Could not find Governmental Power or Governmental Sphere" + Then I should see "Governmental power can't be blank" + And I should see "Governmental sphere can't be blank" + And I should see "Juridical nature can't be blank" @selenium - Scenario: Don't Create new institution when a governamental field is not filled + Scenario: Don't Create new institution when no field is filled Given I go to /account/signup - When I follow "Add new institution" + When I follow "Create new institution" And I choose "Public Institution" And I follow "Save" Then I should see "Institution could not be created!" - And I should see "Governmental fields Could not find Governmental Power or Governmental Sphere" And I should see "Name can't be blank" + And I should see "Country can't be blank" + And I should see "State can't be blank" + And I should see "City can't be blank" + And I should see "Governmental power can't be blank" + And I should see "Governmental sphere can't be blank" + And I should see "Juridical nature can't be blank" And I should see "CNPJ can't be blank" diff --git a/features/step_definitions/mpog_steps.rb b/features/step_definitions/mpog_steps.rb index f6976fb..d0677b6 100644 --- a/features/step_definitions/mpog_steps.rb +++ b/features/step_definitions/mpog_steps.rb @@ -24,6 +24,7 @@ Given /^Institutions has initial default values on database$/ do GovernmentalPower.create(:name => "Judiciario") GovernmentalSphere.create(:name => "Federal") + JuridicalNature.create(:name=> "Autarquia") end Given /^I type in "([^"]*)" into autocomplete list "([^"]*)" and I choose "([^"]*)"$/ do |typed, input_institution, should_select| -- libgit2 0.21.2