From 89d144e1f21c14c204e09edea42c54334ab0418e Mon Sep 17 00:00:00 2001 From: Larissa Reis Date: Sun, 9 Nov 2014 19:46:23 -0300 Subject: [PATCH] Fixes remaining custom_forms plugin broken tests --- plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb | 2 +- plugins/custom_forms/test/unit/custom_forms_plugin/admission_survey_test.rb | 2 +- plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb | 2 +- plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb | 4 ++-- plugins/custom_forms/test/unit/ext/role_assingment_test.rb | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb b/plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb index c9ddecd..892c150 100644 --- a/plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb +++ b/plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb @@ -226,7 +226,7 @@ class CustomFormsPluginMyprofileControllerTest < ActionController::TestCase end should 'list pending submissions for a form' do - person = fast_create(Person) + person = create_user('john').person form = CustomFormsPlugin::Form.create!(:profile => profile, :name => 'Free Software', :for_admission => true) task = CustomFormsPlugin::AdmissionSurvey.create!(:form_id => form.id, :target => person, :requestor => profile) diff --git a/plugins/custom_forms/test/unit/custom_forms_plugin/admission_survey_test.rb b/plugins/custom_forms/test/unit/custom_forms_plugin/admission_survey_test.rb index 7061835..4f4c201 100644 --- a/plugins/custom_forms/test/unit/custom_forms_plugin/admission_survey_test.rb +++ b/plugins/custom_forms/test/unit/custom_forms_plugin/admission_survey_test.rb @@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/../../../../../test/test_helper' class CustomFormsPlugin::AdmissionSurveyTest < ActiveSupport::TestCase should 'add member to community on perform' do profile = fast_create(Community) - person = fast_create(Person) + person = create_user('john').person form = CustomFormsPlugin::Form.create!(:name => 'Simple Form', :profile => profile) task = CustomFormsPlugin::AdmissionSurvey.create!(:form_id => form.id, :target => person, :requestor => profile) diff --git a/plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb b/plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb index 1d3572b..74f81c3 100644 --- a/plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb +++ b/plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb @@ -244,7 +244,7 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase should 'cancel survey tasks after removing a form' do profile = fast_create(Profile) - person = fast_create(Person) + person = create_user('john').person form1 = CustomFormsPlugin::Form.create!(:name => 'Free Software', :profile => profile) form2 = CustomFormsPlugin::Form.create!(:name => 'Operation System', :profile => profile) diff --git a/plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb b/plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb index 78f667d..00e3713 100644 --- a/plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb +++ b/plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb @@ -13,7 +13,7 @@ class CustomFormsPlugin::MembershipSurveyTest < ActiveSupport::TestCase should 'create submission with answers on perform' do profile = fast_create(Profile) - person = fast_create(Person) + person = create_user('john').person form = CustomFormsPlugin::Form.create!(:name => 'Simple Form', :profile => profile) field = CustomFormsPlugin::Field.create!(:name => 'Name', :form => form) 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 should 'have a scope that retrieves all tasks requested by profile' do profile = fast_create(Profile) - person = fast_create(Person) + person = create_user('john').person form = CustomFormsPlugin::Form.create!(:name => 'Simple Form', :profile => profile) task1 = CustomFormsPlugin::MembershipSurvey.create!(:form_id => form.id, :target => person, :requestor => profile) task2 = CustomFormsPlugin::MembershipSurvey.create!(:form_id => form.id, :target => person, :requestor => fast_create(Profile)) diff --git a/plugins/custom_forms/test/unit/ext/role_assingment_test.rb b/plugins/custom_forms/test/unit/ext/role_assingment_test.rb index 150dd65..5d2fbec 100644 --- a/plugins/custom_forms/test/unit/ext/role_assingment_test.rb +++ b/plugins/custom_forms/test/unit/ext/role_assingment_test.rb @@ -5,7 +5,7 @@ class RoleAssignmentsTest < ActiveSupport::TestCase environment = Environment.default environment.enable_plugin(CustomFormsPlugin) organization = fast_create(Organization) - person = fast_create(Person) + person = create_user('john').person f1 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 1', :on_membership => true) f2 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 2', :on_membership => true) f3 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 3', :on_membership => false) @@ -19,7 +19,7 @@ class RoleAssignmentsTest < ActiveSupport::TestCase environment = Environment.default environment.enable_plugin(CustomFormsPlugin) organization = fast_create(Organization) - person = fast_create(Person) + person = create_user('john').person form = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form', :on_membership => true, :access => 'associated') assert_difference 'CustomFormsPlugin::MembershipSurvey.count', 1 do @@ -31,7 +31,7 @@ class RoleAssignmentsTest < ActiveSupport::TestCase environment = Environment.default environment.enable_plugin(CustomFormsPlugin) organization = fast_create(Organization) - person = fast_create(Person) + person = create_user('john').person form1 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 1', :on_membership => true) organization.add_member(person) @@ -59,7 +59,7 @@ class RoleAssignmentsTest < ActiveSupport::TestCase environment = Environment.default environment.enable_plugin(CustomFormsPlugin) organization = fast_create(Organization) - person = fast_create(Person) + person = create_user('john').person f1 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 1', :for_admission => true) f2 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 2', :for_admission => true) f3 = CustomFormsPlugin::Form.create!(:profile => organization, :name => 'Form 3', :for_admission => false) -- libgit2 0.21.2