diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index d43eb14..ad28396 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -686,7 +686,7 @@ module ApplicationHelper
field_html += capture(&block)
end
if (controller.action_name == 'signup')
- if profile.signup_fields.include?(name)
+ if profile.signup_fields.include?(name) || profile.required_fields.include?(name)
result = field_html
end
else
diff --git a/test/unit/application_helper_test.rb b/test/unit/application_helper_test.rb
index 505643c..08de7f1 100644
--- a/test/unit/application_helper_test.rb
+++ b/test/unit/application_helper_test.rb
@@ -332,6 +332,21 @@ class ApplicationHelperTest < Test::Unit::TestCase
assert_equal 'SIGNUP_FIELD', optional_field(profile, 'field', 'SIGNUP_FIELD')
end
+ should 'display required fields on signup even if admin did not marked field to show up in signup' do
+ env = Environment.create!(:name => 'env test')
+ stubs(:environment).returns(env)
+
+ controller = mock
+ stubs(:controller).returns(controller)
+ controller.expects(:action_name).returns('signup')
+
+ stubs(:required).with('SIGNUP_FIELD').returns('SIGNUP_FIELD')
+ profile = Person.new
+ profile.stubs(:required_fields).returns(['field'])
+ profile.stubs(:signup_fields).returns([])
+ assert_equal 'SIGNUP_FIELD', optional_field(profile, 'field', 'SIGNUP_FIELD')
+ end
+
should 'not ask_to_join unless profile defined' do
e = Environment.default
e.stubs(:enabled?).with(:disable_join_community_popup).returns(false)
--
libgit2 0.21.2