From 36475a0ec017297f4bbe8282cc49cfd72986d177 Mon Sep 17 00:00:00 2001 From: Fabio Teixeira Date: Mon, 13 Oct 2014 14:40:25 -0300 Subject: [PATCH] correcoes_aderencia: Add text information to use governmental e-mail --- features/step_definitions/mpog_steps.rb | 18 ++++++++++++++++++ features/user_profile_edition.feature | 7 ++++++- public/mpog-user-validations.js | 1 + views/person_editor_extras.html.erb | 3 ++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/features/step_definitions/mpog_steps.rb b/features/step_definitions/mpog_steps.rb index f34aa40..635ff8e 100644 --- a/features/step_definitions/mpog_steps.rb +++ b/features/step_definitions/mpog_steps.rb @@ -168,3 +168,21 @@ end Given /^I sleep for (\d+) seconds$/ do |time| sleep time.to_i end + +Given /^I am logged in as mpog_admin$/ do + visit('/account/logout') + + user = User.new(:login => 'admin_user', :password => '123456', :password_confirmation => '123456', :email => 'admin_user@example.com') + person = Person.new :name=>"Mpog Admin", :identifier=>"mpog-admin" + user.person = person + user.save! + + user.activate + e = Environment.default + e.add_admin(user.person) + + visit('/account/login') + fill_in("Username", :with => user.login) + fill_in("Password", :with => '123456') + click_button("Log in") +end diff --git a/features/user_profile_edition.feature b/features/user_profile_edition.feature index 834f1dc..4d4c677 100644 --- a/features/user_profile_edition.feature +++ b/features/user_profile_edition.feature @@ -5,7 +5,7 @@ Feature: Institution Field Background: Given "MpogSoftwarePlugin" plugin is enabled - And I am logged in as admin + And I am logged in as mpog_admin And I go to /admin/plugins And I check "MpogSoftwarePlugin" And I press "Save changes" @@ -43,3 +43,8 @@ Feature: Institution Field Then I should see "Ministerio do Planejamento" within ".institutions_added" And I should see "Governo do DF" within ".institutions_added" + @selenium + Scenario: Verify text information to use governmental e-mail + Given I am on josesilva's control panel + And I follow "Edit Profile" + Then I should see "If you work in a public agency use your government e-Mail" \ No newline at end of file diff --git a/public/mpog-user-validations.js b/public/mpog-user-validations.js index 3523830..a4dc920 100644 --- a/public/mpog-user-validations.js +++ b/public/mpog-user-validations.js @@ -60,6 +60,7 @@ function set_initial_form_custom_data(selectFieldChoices) { jQuery('#profile_data_country').val("BR"); jQuery("#password-balloon").html(jQuery("#user_password_menssage").val()); + jQuery("#profile_data_email").parent().append(jQuery("#email_public_message").remove()); selectFieldChoices.setSelect(); } diff --git a/views/person_editor_extras.html.erb b/views/person_editor_extras.html.erb index 4c19612..fe7c1f3 100644 --- a/views/person_editor_extras.html.erb +++ b/views/person_editor_extras.html.erb @@ -35,4 +35,5 @@ <%= hidden_field_tag("full_name_error", _("Should begin with a capital letter and no special characters")) %> <%= hidden_field_tag("email_error", _("Email should have the following format: name@host.br")) %> -<%= hidden_field_tag("site_error", _("Site should have a valid format: http://name.hosts")) %> \ No newline at end of file +<%= hidden_field_tag("site_error", _("Site should have a valid format: http://name.hosts")) %> +
<%= _("If you work in a public agency use your government e-Mail") %>
\ No newline at end of file -- libgit2 0.21.2