Commit 0bdd71fcc5ed6dd19ef520af0d4640d8a4853f1d

Authored by Gabriela Navarro
1 parent 1f8b48d3

corrections: remove area of interest from forms.

Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com>
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
features/user_registration.feature
... ... @@ -32,6 +32,15 @@ Feature: User Registration
32 32 | Ministerio das Cidades | MC | BR | DF | Gama | 58.745.189/0001-21 | Autarquia | Executivo | Federal |
33 33 | Governo do DF | GDF | BR | DF | Taguatinga | 12.645.166/0001-44 | Autarquia | Legislativo | Federal |
34 34 | Ministerio do Planejamento | MP | BR | DF | Brasilia | 41.769.591/0001-43 | Autarquia | Judiciario | Federal |
  35 + And I fill in the following within ".no-boxes":
  36 + | e-Mail | josesilva@serpro.gov.br|
  37 + | Username | josesilva |
  38 + | Password | secret |
  39 + | Password confirmation | secret |
  40 + | Full name | José da Silva |
  41 + | State | Bahia |
  42 + | City | Salvador |
  43 + | Secondary e-Mail | josesilva@example.com |
35 44 And I type in "Minis" into autocomplete list "input_institution" and I choose "Ministerio do Planejamento"
36 45 And I follow "Add new institution"
37 46 Then I should see "Ministerio do Planejamento" within ".institutions_added"
... ... @@ -45,10 +54,157 @@ Feature: User Registration
45 54 | Ministerio das Cidades | MC | BR | DF | Gama | 58.745.189/0001-21 | Autarquia | Executivo | Federal |
46 55 | Governo do DF | GDF | BR | DF | Taguatinga | 12.645.166/0001-44 | Autarquia | Legislativo | Federal |
47 56 | Ministerio do Planejamento | MP | BR | DF | Brasilia | 41.769.591/0001-43 | Autarquia | Judiciario | Federal |
  57 + And I fill in the following within ".no-boxes":
  58 + | e-Mail | josesilva@serpro.gov.br|
  59 + | Username | josesilva |
  60 + | Password | secret |
  61 + | Password confirmation | secret |
  62 + | Full name | José da Silva |
  63 + | State | Bahia |
  64 + | City | Salvador |
  65 + | Secondary e-Mail | josesilva@example.com |
48 66 And I type in "MP" into autocomplete list "input_institution" and I choose "Ministerio do Planejamento"
49 67 And I follow "Add new institution"
50   - Then I should see "Ministerio do Planejamento" within ".institutions_added"
51   -
  68 + And I press "Create my account"
  69 + When José da Silva's account is activated
  70 + And I go to login page
  71 + And I fill in "Username" with "josesilva"
  72 + And I fill in "Password" with "secret"
  73 + And I press "Log in"
  74 + Then I should be logged in as "josesilva"
  75 +
  76 + @selenium
  77 + Scenario: Unsuccessfull registration due to the existance of e-mail as secondary another user's e-mail
  78 + Given the following users
  79 + | login | name | email | country | state | city |
  80 + | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia |
  81 + And the user "maria" has "user@example.com" as secondary e-mail
  82 + And I go to /account/signup
  83 + And I fill in the following within ".no-boxes":
  84 + | e-Mail | user@example.com |
  85 + | Username | josesilva |
  86 + | Password | secret |
  87 + | Password confirmation | secret |
  88 + | Full name | José da Silva |
  89 + | State | Bahia |
  90 + | City | Salvador |
  91 + And wait for the captcha signup time
  92 + And I select "Brazil" from "profile_data[country]"
  93 + When I press "Create my account"
  94 + Then I should see "E-mail or secondary e-mail already taken."
  95 +
  96 + @selenium
  97 + Scenario: Unsuccessfull registration due to the existance of secondary e-mail as another user's secondary e-mail
  98 + Given the following users
  99 + | login | name | email | country | state | city |
  100 + | maria | Maria Silva | maria@example.com | Brazil | DF | Brasilia |
  101 + And the user "maria" has "user@example.com" as secondary e-mail
  102 + And I go to /account/signup
  103 + And I fill in the following within ".no-boxes":
  104 + | e-Mail | josesilva@example.com |
  105 + | Username | josesilva |
  106 + | Password | secret |
  107 + | Password confirmation | secret |
  108 + | Full name | José da Silva |
  109 + | State | Bahia |
  110 + | City | Salvador |
  111 + | Secondary e-Mail | user@example.com |
  112 + And I select "Brazil" from "profile_data[country]"
  113 + And wait for the captcha signup time
  114 + When I press "Create my account"
  115 + Then I should see "E-mail or secondary e-mail already taken."
  116 +
  117 + @selenium
  118 + Scenario: Unsuccessfull registration due to the existance of secondary e-mail as another user's e-mail
  119 + Given the following users
  120 + | login | name | email | country | state | city |
  121 + | maria | Maria Silva | user@example.com | Brazil | DF | Brasilia |
  122 + And I go to /account/signup
  123 + And I fill in the following within ".no-boxes":
  124 + | e-Mail | josesilva@example.com |
  125 + | Username | josesilva |
  126 + | Password | secret |
  127 + | Password confirmation | secret |
  128 + | Full name | José da Silva |
  129 + | State | Bahia |
  130 + | City | Salvador |
  131 + | Secondary e-Mail | user@example.com |
  132 + And I select "Brazil" from "profile_data[country]"
  133 + And wait for the captcha signup time
  134 + When I press "Create my account"
  135 + Then I should see "E-mail or secondary e-mail already taken."
  136 +
  137 + @selenium
  138 + Scenario: Unsuccessfull registration due to both primary e-mail and secondary e-mail being equal
  139 + Given I go to /account/signup
  140 + And I fill in the following within ".no-boxes":
  141 + | Username | josesilva |
  142 + | e-Mail | josesilva@example.com |
  143 + | Password | secret |
  144 + | Password confirmation | secret |
  145 + | Full name | José da Silva |
  146 + | State | Bahia |
  147 + | City | Salvador |
  148 + | Secondary e-Mail | josesilva@example.com |
  149 + And I select "Brazil" from "profile_data[country]"
  150 + And wait for the captcha signup time
  151 + When I press "Create my account"
  152 + Then I should see "Email must be different from secondary email."
  153 +
  154 + @selenium
  155 + Scenario: Unsuccessfull registration due to government fields being blank
  156 + Given I go to /account/signup
  157 + And I fill in the following within ".no-boxes":
  158 + | Username | josesilva |
  159 + | e-Mail | josesilva@serpro.gov.br|
  160 + | Password | secret |
  161 + | Password confirmation | secret |
  162 + | Full name | José da Silva |
  163 + | Secondary e-Mail | josesilva@example.com |
  164 + And wait for the captcha signup time
  165 + When I press "Create my account"
  166 + And I should see "Institution is obligatory if user has a government email."
  167 + And I should see "State can't be blank"
  168 + And I should see "City can't be blank"
  169 +
  170 + @selenium
  171 + Scenario: Unsuccessfull registration due to secondary email is governmental and primary is not
  172 + Given I go to /account/signup
  173 + And I fill in the following within ".no-boxes":
  174 + | Username | josesilva |
  175 + | e-Mail | josesilva@example.com |
  176 + | Password | secret |
  177 + | Password confirmation | secret |
  178 + | Full name | José da Silva |
  179 + | State | Bahia |
  180 + | City | Salvador |
  181 + | Secondary e-Mail | josesilva@serpro.gov.br|
  182 + And wait for the captcha signup time
  183 + When I press "Create my account"
  184 + Then I should see "The governamental email must be the primary one."
  185 +
  186 + @selenium-fixme
  187 + Scenario: Show incomplete resgistration percentage
  188 + Given I go to /account/signup
  189 + And I fill in the following within ".no-boxes":
  190 + | e-Mail | josesilva@gmail.com |
  191 + | Password | secret |
  192 + | Password confirmation | secret |
  193 + | Full name | José da Silva |
  194 + | State | Bahia |
  195 + | City | Salvador |
  196 + | Secondary e-Mail | josesilva@example.com |
  197 + And I select "Brazil" from "profile_data[country]"
  198 + And I fill in "Username" with "josesilva"
  199 + And wait for the captcha signup time
  200 + And I press "Create my account"
  201 + When José da Silva's account is activated
  202 + And I go to login page
  203 + And I fill in "Username" with "josesilva"
  204 + And I fill in "Password" with "secret"
  205 + And I press "Log in"
  206 + Then I should see "Complete Profile: 37%"
  207 +>>>>>>> a8e75c7... corrections: remove area of interest from forms.
52 208  
53 209 @selenium
54 210 Scenario: Remove the incomplete resgistration percentage message
... ...
lib/ext/person.rb
... ... @@ -2,10 +2,8 @@ require_dependency &#39;person&#39;
2 2  
3 3 class Person
4 4  
5   - settings_items :area_interest, :type => :string, :default => ""
6 5 settings_items :percentage_incomplete, :type => :string, :default => ""
7 6  
8   - attr_accessible :area_interest
9 7 attr_accessible :percentage_incomplete
10 8  
11 9 scope :search, lambda { |name="", state="", city="", email=""|
... ...
lib/mpog_software_plugin.rb
... ... @@ -31,15 +31,6 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin
31 31  
32 32 content_tag(:div,
33 33 labelled_form_field(
34   - _('Areas of Interest'),
35   - text_field(:profile_data, :area_interest, :id => 'area_interest_field')+
36   - content_tag(
37   - :small,_('Fill with your interest areas'),:class => 'signup-form',:id =>'area-interest-balloon')),
38   - :id => 'signup-area-interest'
39   - ) +
40   -
41   - content_tag(:div,
42   - labelled_form_field(
43 34 _('Institutions'),
44 35 content_tag(:div,
45 36 text_field(:institution, :name, :id=>"input_institution"),
... ... @@ -274,7 +265,7 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin
274 265 end
275 266  
276 267 def profile_required_list
277   - required_list = ["cell_phone","contact_phone","institutions","comercial_phone","country","city","state","organization_website","area_interest","image"]
  268 + required_list = ["cell_phone","contact_phone","institutions","comercial_phone","country","city","state","organization_website","image"]
278 269 end
279 270  
280 271 def profile_required_empty_list person
... ...
test/functional/account_controller_test.rb
... ... @@ -41,7 +41,6 @@ class AccountControllerTest &lt; ActionController::TestCase
41 41  
42 42 @profile_data_info = {
43 43 :name=>"Um novo usuario",
44   - :area_interest=>"uma area ai"
45 44 }
46 45  
47 46 @second_profile_data_info = {
... ... @@ -161,24 +160,23 @@ class AccountControllerTest &lt; ActionController::TestCase
161 160 institution
162 161 end
163 162  
164   - # def form_params
165   - # user = {
166   - # :login=>"novo_usuario",
167   - # :password=>"nova_senha",
168   - # :password_confirmation=>"nova_senha",
169   - # :email=>"um@novo.usuario",
170   - # :secondary_email=>"outro@email.com",
171   - # :institution_ids=>[@institution_list.last.id]
172   - # }
173   -
174   - # profile_data = {
175   - # :name=>"Um novo usuario",
176   - # :area_interest=>"uma area ai"
177   - # }
178   -
179   - # user["profile_data"] = profile_data
180   - # user
181   - # end
  163 + def form_params
  164 + user = {
  165 + :login=>"novo_usuario",
  166 + :password=>"nova_senha",
  167 + :password_confirmation=>"nova_senha",
  168 + :email=>"um@novo.usuario",
  169 + :secondary_email=>"outro@email.com",
  170 + :institution_ids=>[@institution_list.last.id]
  171 + }
  172 +
  173 + profile_data = {
  174 + :name=>"Um novo usuario",
  175 + }
  176 +
  177 + user["profile_data"] = profile_data
  178 + user
  179 + end
182 180  
183 181 def disable_signup_bot_check(environment = Environment.default)
184 182 environment.min_signup_delay = 0
... ...
test/unit/mpog_software_plugin_test.rb
... ... @@ -24,7 +24,7 @@ class MpogSoftwarePluginTest &lt; ActiveSupport::TestCase
24 24 @person.name = "Person Name"
25 25 @person.cell_phone = "76888919"
26 26  
27   - required_list = ["cell_phone","contact_phone","institution","comercial_phone","country","city","state","organization_website","area_interest","image"]
  27 + required_list = ["cell_phone","contact_phone","institution","comercial_phone","country","city","state","organization_website","image"]
28 28  
29 29 empty_fields = required_list.count - 1
30 30 test_percentege = 100 - ((empty_fields * 100) / required_list.count)
... ...
views/person_editor_extras.html.erb
... ... @@ -6,14 +6,6 @@
6 6 </div>
7 7 </div>
8 8  
9   -<div class="formfieldline">
10   - <%= label_tag 'profile_data[area_interest]', _('Areas of Interest'), :class=>"formlabel" %>
11   -
12   - <div class="formfield type-text">
13   - <%= text_field_tag 'profile_data[area_interest]', context.profile.area_interest %>
14   - </div>
15   -</div>
16   -
17 9 <div class="formfieldline" id="select_institution">
18 10 <%= label_tag "user[institution_ids]", _('Institutions'), :class=>"formlabel" %>
19 11  
... ...
views/profile/_profile_tab.html.erb
... ... @@ -4,6 +4,5 @@
4 4 </tr>
5 5  
6 6 <%= display_field(_('Secondary E-mail:'), profile, :secondary_email, true) %>
7   - <%= display_field(_('Areas of Interest:'), profile, :area_interest, true) %>
8 7 <%= display_field(_('Institution:'), profile, :institutions, true) %>
9 8 </table>
... ...