Commit 36475a0ec017297f4bbe8282cc49cfd72986d177

Authored by Fabio Teixeira
1 parent 34ab0d8e
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

correcoes_aderencia: Add text information to use governmental e-mail

Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
features/step_definitions/mpog_steps.rb
... ... @@ -168,3 +168,21 @@ end
168 168 Given /^I sleep for (\d+) seconds$/ do |time|
169 169 sleep time.to_i
170 170 end
  171 +
  172 +Given /^I am logged in as mpog_admin$/ do
  173 + visit('/account/logout')
  174 +
  175 + user = User.new(:login => 'admin_user', :password => '123456', :password_confirmation => '123456', :email => 'admin_user@example.com')
  176 + person = Person.new :name=>"Mpog Admin", :identifier=>"mpog-admin"
  177 + user.person = person
  178 + user.save!
  179 +
  180 + user.activate
  181 + e = Environment.default
  182 + e.add_admin(user.person)
  183 +
  184 + visit('/account/login')
  185 + fill_in("Username", :with => user.login)
  186 + fill_in("Password", :with => '123456')
  187 + click_button("Log in")
  188 +end
... ...
features/user_profile_edition.feature
... ... @@ -5,7 +5,7 @@ Feature: Institution Field
5 5  
6 6 Background:
7 7 Given "MpogSoftwarePlugin" plugin is enabled
8   - And I am logged in as admin
  8 + And I am logged in as mpog_admin
9 9 And I go to /admin/plugins
10 10 And I check "MpogSoftwarePlugin"
11 11 And I press "Save changes"
... ... @@ -43,3 +43,8 @@ Feature: Institution Field
43 43 Then I should see "Ministerio do Planejamento" within ".institutions_added"
44 44 And I should see "Governo do DF" within ".institutions_added"
45 45  
  46 + @selenium
  47 + Scenario: Verify text information to use governmental e-mail
  48 + Given I am on josesilva's control panel
  49 + And I follow "Edit Profile"
  50 + Then I should see "If you work in a public agency use your government e-Mail"
46 51 \ No newline at end of file
... ...
public/mpog-user-validations.js
... ... @@ -60,6 +60,7 @@
60 60 function set_initial_form_custom_data(selectFieldChoices) {
61 61 jQuery('#profile_data_country').val("BR");
62 62 jQuery("#password-balloon").html(jQuery("#user_password_menssage").val());
  63 + jQuery("#profile_data_email").parent().append(jQuery("#email_public_message").remove());
63 64  
64 65 selectFieldChoices.setSelect();
65 66 }
... ...
views/person_editor_extras.html.erb
... ... @@ -35,4 +35,5 @@
35 35  
36 36 <%= hidden_field_tag("full_name_error", _("Should begin with a capital letter and no special characters")) %>
37 37 <%= hidden_field_tag("email_error", _("Email should have the following format: name@host.br")) %>
38   -<%= hidden_field_tag("site_error", _("Site should have a valid format: http://name.hosts")) %>
39 38 \ No newline at end of file
  39 +<%= hidden_field_tag("site_error", _("Site should have a valid format: http://name.hosts")) %>
  40 +<div id="email_public_message"><%= _("If you work in a public agency use your government e-Mail") %> </div>
40 41 \ No newline at end of file
... ...