Commit 38468efac2fbc9898b9d86f86b9c4e96cba9d467

Authored by Daniel
2 parents 24837fa6 0f28f08f
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

Merge branch 'master' of gitlab.com:softwarepublico/mpog_software

features/institution_registration.feature 0 → 100644
... ... @@ -0,0 +1,93 @@
  1 +Feature: Institution Field
  2 + As a user
  3 + I want to sign up resgistring my institution
  4 + So others users can use it
  5 +
  6 + Background:
  7 + Given "MpogSoftwarePlugin" plugin is enabled
  8 + And I am logged in as admin
  9 + And I go to /admin/plugins
  10 + And I check "MpogSoftwarePlugin"
  11 + And I press "Save changes"
  12 + And I go to /account/logout
  13 + And Institutions has initial default values on database
  14 +
  15 + @selenium
  16 + Scenario: Show new institution field when follow add new institution
  17 + Given I go to /account/signup
  18 + When I follow "Add new institution"
  19 + And I should see "New Institution"
  20 + And I should see "Name"
  21 + And I should see "CNPJ"
  22 + And I should see "Public Institution"
  23 + And I choose "Public Institution"
  24 + And I should see "Acronym"
  25 + And I should see "Governmental Power:"
  26 + Then I should see "Governmental Sphere:"
  27 +
  28 + @selenium
  29 + Scenario: Show new institution fields when private institution is selected
  30 + Given I go to /account/signup
  31 + When I follow "Add new institution"
  32 + And I should see "New Institution"
  33 + And I should see "Name"
  34 + And I should see "CNPJ"
  35 + And I should see "Private Institution"
  36 + And I choose "Private Institution"
  37 + Then I should see "Fantasy name"
  38 +
  39 + @selenium
  40 + Scenario: Create new public institution when all required fields are filled.
  41 + Given I go to /account/signup
  42 + When I follow "Add new institution"
  43 + And I fill in "community_name" with "Institution Name"
  44 + And I fill in "institutions_cnpj" with "00.000.000/0001-00"
  45 + And I choose "Public Institution"
  46 + And I fill in "institutions_acronym" with "Teste"
  47 + And I select "Executivo" from "institutions_governmental_power"
  48 + And I select "Federal" from "institutions_governmental_sphere"
  49 + And I follow "Save"
  50 + Then I should see "Institution Name"
  51 +
  52 + @selenium
  53 + Scenario: Create new private institution when all required fields are filled
  54 + Given I go to /account/signup
  55 + When I follow "Add new institution"
  56 + And I fill in "community_name" with "Institution Name"
  57 + And I fill in "institutions_cnpj" with "00.000.000/0001-00"
  58 + And I choose "Private Institution"
  59 + And I fill in "institutions_acronym" with "Teste"
  60 + And I follow "Save"
  61 + Then I should see "Institution Name"
  62 +
  63 + @selenium
  64 + Scenario: Don't create an institution when name and cpnj are not filled
  65 + Given I go to /account/signup
  66 + When I follow "Add new institution"
  67 + And I choose "Private Institution"
  68 + And I fill in "institutions_acronym" with "Teste"
  69 + And I follow "Save"
  70 + Then I should see "Institution could not be created!"
  71 + And I should see "Name can't be blank"
  72 + And I should see "CNPJ can't be blank"
  73 +
  74 + @selenium
  75 + Scenario: Don't Create new institution when a governamental field is not filled
  76 + Given I go to /account/signup
  77 + When I follow "Add new institution"
  78 + And I fill in "community_name" with "Institution Name"
  79 + And I fill in "institutions_cnpj" with "00.000.000/0001-00"
  80 + And I choose "Public Institution"
  81 + And I follow "Save"
  82 + Then I should see "Governmental fields Could not find Governmental Power or Governmental Sphere"
  83 +
  84 + @selenium
  85 + Scenario: Don't Create new institution when a governamental field is not filled
  86 + Given I go to /account/signup
  87 + When I follow "Add new institution"
  88 + And I choose "Public Institution"
  89 + And I follow "Save"
  90 + 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"
  93 + And I should see "CNPJ can't be blank"
... ...
features/instution_field.feature
... ... @@ -1,21 +0,0 @@
1   -Feature: Institution Field
2   - As a user
3   - I want to sign up resgistring my institution
4   - So others users can use it
5   -
6   - Background:
7   - Given "MpogSoftwarePlugin" plugin is enabled
8   - And I am logged in as admin
9   - And I go to /admin/plugins
10   - And I check "MpogSoftwarePlugin"
11   - And I press "Save changes"
12   - And I go to /account/logout
13   -
14   - @selenium
15   - Scenario: Show new institution field when another institution is selected
16   - Given I go to /account/signup
17   - When I select "Other" from "Institution"
18   - And I should see "New Institution"
19   - And I fill in "institution_name" with "Test Institution"
20   - And I fill in "profile_data_name" with " "
21   - Then I should see "Test Institution" within "#user_institution_id"