Commit 89d144e1f21c14c204e09edea42c54334ab0418e
1 parent
906f3005
Exists in
master
and in
22 other branches
Fixes remaining custom_forms plugin broken tests
fast_create(Person) used on tests leaves the user blank so the target for the email had no address causing deliver to throw an error, so I just replaced fast_create for create_user This patch just makes the tests pass. I haven't tested the plugin myself so I have no guarantee it works.
Showing
5 changed files
with
9 additions
and
9 deletions
Show diff stats
plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb
| @@ -226,7 +226,7 @@ class CustomFormsPluginMyprofileControllerTest < ActionController::TestCase | @@ -226,7 +226,7 @@ class CustomFormsPluginMyprofileControllerTest < ActionController::TestCase | ||
| 226 | end | 226 | end |
| 227 | 227 | ||
| 228 | should 'list pending submissions for a form' do | 228 | should 'list pending submissions for a form' do |
| 229 | - person = fast_create(Person) | 229 | + person = create_user('john').person |
| 230 | form = CustomFormsPlugin::Form.create!(:profile => profile, :name => 'Free Software', :for_admission => true) | 230 | form = CustomFormsPlugin::Form.create!(:profile => profile, :name => 'Free Software', :for_admission => true) |
| 231 | task = CustomFormsPlugin::AdmissionSurvey.create!(:form_id => form.id, :target => person, :requestor => profile) | 231 | task = CustomFormsPlugin::AdmissionSurvey.create!(:form_id => form.id, :target => person, :requestor => profile) |
| 232 | 232 |
plugins/custom_forms/test/unit/custom_forms_plugin/admission_survey_test.rb
| @@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/../../../../../test/test_helper' | @@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/../../../../../test/test_helper' | ||
| 3 | class CustomFormsPlugin::AdmissionSurveyTest < ActiveSupport::TestCase | 3 | class CustomFormsPlugin::AdmissionSurveyTest < ActiveSupport::TestCase |
| 4 | should 'add member to community on perform' do | 4 | should 'add member to community on perform' do |
| 5 | profile = fast_create(Community) | 5 | profile = fast_create(Community) |
| 6 | - person = fast_create(Person) | 6 | + person = create_user('john').person |
| 7 | form = CustomFormsPlugin::Form.create!(:name => 'Simple Form', :profile => profile) | 7 | form = CustomFormsPlugin::Form.create!(:name => 'Simple Form', :profile => profile) |
| 8 | task = CustomFormsPlugin::AdmissionSurvey.create!(:form_id => form.id, :target => person, :requestor => profile) | 8 | task = CustomFormsPlugin::AdmissionSurvey.create!(:form_id => form.id, :target => person, :requestor => profile) |
| 9 | 9 |
plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb
| @@ -244,7 +244,7 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase | @@ -244,7 +244,7 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase | ||
| 244 | 244 | ||
| 245 | should 'cancel survey tasks after removing a form' do | 245 | should 'cancel survey tasks after removing a form' do |
| 246 | profile = fast_create(Profile) | 246 | profile = fast_create(Profile) |
| 247 | - person = fast_create(Person) | 247 | + person = create_user('john').person |
| 248 | 248 | ||
| 249 | form1 = CustomFormsPlugin::Form.create!(:name => 'Free Software', :profile => profile) | 249 | form1 = CustomFormsPlugin::Form.create!(:name => 'Free Software', :profile => profile) |
| 250 | form2 = CustomFormsPlugin::Form.create!(:name => 'Operation System', :profile => profile) | 250 | form2 = CustomFormsPlugin::Form.create!(:name => 'Operation System', :profile => profile) |
plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb
| @@ -13,7 +13,7 @@ class CustomFormsPlugin::MembershipSurveyTest < ActiveSupport::TestCase | @@ -13,7 +13,7 @@ class CustomFormsPlugin::MembershipSurveyTest < ActiveSupport::TestCase | ||
| 13 | 13 | ||
| 14 | should 'create submission with answers on perform' do | 14 | should 'create submission with answers on perform' do |
| 15 | profile = fast_create(Profile) | 15 | profile = fast_create(Profile) |
| 16 | - person = fast_create(Person) | 16 | + person = create_user('john').person |
| 17 | form = CustomFormsPlugin::Form.create!(:name => 'Simple Form', :profile => profile) | 17 | form = CustomFormsPlugin::Form.create!(:name => 'Simple Form', :profile => profile) |
| 18 | field = CustomFormsPlugin::Field.create!(:name => 'Name', :form => form) | 18 | field = CustomFormsPlugin::Field.create!(:name => 'Name', :form => form) |
| 19 | task = CustomFormsPlugin::MembershipSurvey.create!(:form_id => form.id, :submission => {field.id.to_s => 'Jack'}, :target => person, :requestor => profile) | 19 | task = CustomFormsPlugin::MembershipSurvey.create!(:form_id => form.id, :submission => {field.id.to_s => 'Jack'}, :target => person, :requestor => profile) |
| @@ -31,7 +31,7 @@ class CustomFormsPlugin::MembershipSurveyTest < ActiveSupport::TestCase | @@ -31,7 +31,7 @@ class CustomFormsPlugin::MembershipSurveyTest < ActiveSupport::TestCase | ||
| 31 | 31 | ||
| 32 | should 'have a scope that retrieves all tasks requested by profile' do | 32 | should 'have a scope that retrieves all tasks requested by profile' do |
| 33 | profile = fast_create(Profile) | 33 | profile = fast_create(Profile) |
| 34 | - person = fast_create(Person) | 34 | + person = create_user('john').person |
| 35 | form = CustomFormsPlugin::Form.create!(:name => 'Simple Form', :profile => profile) | 35 | form = CustomFormsPlugin::Form.create!(:name => 'Simple Form', :profile => profile) |
| 36 | task1 = CustomFormsPlugin::MembershipSurvey.create!(:form_id => form.id, :target => person, :requestor => profile) | 36 | task1 = CustomFormsPlugin::MembershipSurvey.create!(:form_id => form.id, :target => person, :requestor => profile) |
| 37 | task2 = CustomFormsPlugin::MembershipSurvey.create!(:form_id => form.id, :target => person, :requestor => fast_create(Profile)) | 37 | task2 = CustomFormsPlugin::MembershipSurvey.create!(:form_id => form.id, :target => person, :requestor => fast_create(Profile)) |
plugins/custom_forms/test/unit/ext/role_assingment_test.rb
| @@ -5,7 +5,7 @@ class RoleAssignmentsTest < ActiveSupport::TestCase | @@ -5,7 +5,7 @@ class RoleAssignmentsTest < ActiveSupport::TestCase | ||
| 5 | environment = Environment.default | 5 | environment = Environment.default |
| 6 | environment.enable_plugin(CustomFormsPlugin) | 6 | environment.enable_plugin(CustomFormsPlugin) |
| 7 | organization = fast_create(Organization) | 7 | organization = fast_create(Organization) |
| 8 | - person = fast_create(Person) | 8 | + person = create_user('john').person |
| 9 | f1 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 1', :on_membership => true) | 9 | f1 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 1', :on_membership => true) |
| 10 | f2 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 2', :on_membership => true) | 10 | f2 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 2', :on_membership => true) |
| 11 | f3 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 3', :on_membership => false) | 11 | f3 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 3', :on_membership => false) |
| @@ -19,7 +19,7 @@ class RoleAssignmentsTest < ActiveSupport::TestCase | @@ -19,7 +19,7 @@ class RoleAssignmentsTest < ActiveSupport::TestCase | ||
| 19 | environment = Environment.default | 19 | environment = Environment.default |
| 20 | environment.enable_plugin(CustomFormsPlugin) | 20 | environment.enable_plugin(CustomFormsPlugin) |
| 21 | organization = fast_create(Organization) | 21 | organization = fast_create(Organization) |
| 22 | - person = fast_create(Person) | 22 | + person = create_user('john').person |
| 23 | form = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form', :on_membership => true, :access => 'associated') | 23 | form = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form', :on_membership => true, :access => 'associated') |
| 24 | 24 | ||
| 25 | assert_difference 'CustomFormsPlugin::MembershipSurvey.count', 1 do | 25 | assert_difference 'CustomFormsPlugin::MembershipSurvey.count', 1 do |
| @@ -31,7 +31,7 @@ class RoleAssignmentsTest < ActiveSupport::TestCase | @@ -31,7 +31,7 @@ class RoleAssignmentsTest < ActiveSupport::TestCase | ||
| 31 | environment = Environment.default | 31 | environment = Environment.default |
| 32 | environment.enable_plugin(CustomFormsPlugin) | 32 | environment.enable_plugin(CustomFormsPlugin) |
| 33 | organization = fast_create(Organization) | 33 | organization = fast_create(Organization) |
| 34 | - person = fast_create(Person) | 34 | + person = create_user('john').person |
| 35 | form1 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 1', :on_membership => true) | 35 | form1 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 1', :on_membership => true) |
| 36 | organization.add_member(person) | 36 | organization.add_member(person) |
| 37 | 37 | ||
| @@ -59,7 +59,7 @@ class RoleAssignmentsTest < ActiveSupport::TestCase | @@ -59,7 +59,7 @@ class RoleAssignmentsTest < ActiveSupport::TestCase | ||
| 59 | environment = Environment.default | 59 | environment = Environment.default |
| 60 | environment.enable_plugin(CustomFormsPlugin) | 60 | environment.enable_plugin(CustomFormsPlugin) |
| 61 | organization = fast_create(Organization) | 61 | organization = fast_create(Organization) |
| 62 | - person = fast_create(Person) | 62 | + person = create_user('john').person |
| 63 | f1 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 1', :for_admission => true) | 63 | f1 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 1', :for_admission => true) |
| 64 | f2 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 2', :for_admission => true) | 64 | f2 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 2', :for_admission => true) |
| 65 | f3 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 3', :for_admission => false) | 65 | f3 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 3', :for_admission => false) |