Commit 4bf11ff9d7f6cbc79d2bc85216f1000aa6741efd
1 parent
450e11f4
Exists in
master
and in
29 other branches
stoa-plugin: Fixes broken tests
Showing
3 changed files
with
4 additions
and
4 deletions
Show diff stats
lib/tasks/plugins_tests.rake
plugins/stoa/lib/stoa_plugin.rb
... | ... | @@ -60,13 +60,14 @@ class StoaPlugin < Noosfero::Plugin |
60 | 60 | end |
61 | 61 | |
62 | 62 | def account_controller_filters |
63 | - block = lambda do |context| | |
63 | + block = proc do | |
64 | 64 | params[:profile_data] ||= {} |
65 | 65 | params[:profile_data][:invitation_code] = params[:invitation_code] |
66 | 66 | invitation = Task.pending.find(:first, :conditions => {:code => params[:invitation_code]}) |
67 | 67 | if request.post? |
68 | 68 | if !invitation && !StoaPlugin::UspUser.matches?(params[:profile_data][:usp_id], params[:confirmation_field], params[params[:confirmation_field]]) |
69 | - @person = Person.new(:environment => context.environment) | |
69 | + # `self` below is evaluated in the context of account_controller | |
70 | + @person = Person.new(:environment => self.environment) | |
70 | 71 | @person.errors.add(:usp_id, _(' validation failed')) |
71 | 72 | render :action => :signup |
72 | 73 | end | ... | ... |
plugins/stoa/test/functional/invite_controller_test.rb
... | ... | @@ -57,7 +57,7 @@ class InviteControllerTest < ActionController::TestCase |
57 | 57 | organization.add_admin(admin) |
58 | 58 | |
59 | 59 | login_as(admin.identifier) |
60 | - get :search_friend, :profile => organization.identifier, :q => '1234' | |
60 | + get :search, :profile => organization.identifier, :q => '1234' | |
61 | 61 | |
62 | 62 | assert_equal [{"id" => person.id, "name" => person.name}].to_json, @response.body |
63 | 63 | assert_response 200 | ... | ... |