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