Commit 82305ca6babd1f3700c49ff6c1ff3cc3f78ab527

Authored by Larissa Reis
1 parent 06d5c8c6

stoa-plugin-tests: changes lambda to proc

lib/noosfero/plugin.rb
... ... @@ -389,7 +389,7 @@ class Noosfero::Plugin
389 389 end
390 390  
391 391 # -> Adds fields to the signup form
392   - # returns = lambda block that creates html code
  392 + # returns = proc that creates html code
393 393 def signup_extra_contents
394 394 nil
395 395 end
... ... @@ -464,7 +464,7 @@ class Noosfero::Plugin
464 464 end
465 465  
466 466 # -> Adds fields to the login form
467   - # returns = lambda block that creates html code
  467 + # returns = proc that creates html code
468 468 def login_extra_contents
469 469 nil
470 470 end
... ...
plugins/stoa/lib/stoa_plugin.rb
... ... @@ -15,7 +15,7 @@ class StoaPlugin < Noosfero::Plugin
15 15 end
16 16  
17 17 def signup_extra_contents
18   - lambda {
  18 + proc {
19 19 content_tag(:div, labelled_form_field(_('USP number'), text_field(:profile_data, :usp_id, :id => 'usp_id_field')) +
20 20 content_tag(:small, _('The usp id grants you special powers in the network. Don\'t forget to fill it with a valid number if you have one.'), :id => 'usp-id-balloon') +
21 21 content_tag('p', _("Either this usp number is being used by another user or is not valid"), :id => 'usp-id-invalid') +
... ... @@ -43,7 +43,7 @@ class StoaPlugin < Noosfero::Plugin
43 43 end
44 44  
45 45 def login_extra_contents
46   - lambda {
  46 + proc {
47 47 content_tag('div', labelled_form_field(_('USP number / Username'), text_field_tag('usp_id_login', '', :id => 'stoa_field_login')) +
48 48 labelled_form_field(_('Password'), password_field_tag('password', '', :id => 'stoa_field_password')), :id => 'stoa-login-fields')
49 49 }
... ... @@ -80,7 +80,7 @@ class StoaPlugin < Noosfero::Plugin
80 80 end
81 81  
82 82 def profile_editor_controller_filters
83   - block = lambda do
  83 + block = proc do
84 84 if request.post?
85 85 if !params[:profile_data][:usp_id].blank? && !StoaPlugin::UspUser.matches?(params[:profile_data][:usp_id], params[:confirmation_field], params[params[:confirmation_field]])
86 86 @profile_data = profile
... ... @@ -103,7 +103,7 @@ class StoaPlugin < Noosfero::Plugin
103 103 def invite_controller_filters
104 104 [{ :type => 'before_filter',
105 105 :method_name => 'check_usp_id_existence',
106   - :block => lambda {render_access_denied if !user || user.usp_id.blank?} }]
  106 + :block => proc {render_access_denied if !user || user.usp_id.blank?} }]
107 107 end
108 108  
109 109 def control_panel_buttons
... ...