From 6ee23a50812205ecc3beab40ccb7f72ae423ac56 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 30 Jul 2014 20:03:15 -0300 Subject: [PATCH] work_assignment plugin: fix tests --- plugins/work_assignment/test/unit/work_assingment_plugin/work_assignment_test.rb | 2 +- plugins/work_assignment/test/unit/work_assingment_plugin_test.rb | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/work_assignment/test/unit/work_assingment_plugin/work_assignment_test.rb b/plugins/work_assignment/test/unit/work_assingment_plugin/work_assignment_test.rb index 9d283ec..468177b 100644 --- a/plugins/work_assignment/test/unit/work_assingment_plugin/work_assignment_test.rb +++ b/plugins/work_assignment/test/unit/work_assingment_plugin/work_assignment_test.rb @@ -35,7 +35,7 @@ class WorkAssignmentTest < ActiveSupport::TestCase organization = fast_create(Organization) author = fast_create(Person) work_assignment = WorkAssignmentPlugin::WorkAssignment.create!(:name => 'Sample Work Assignment', :profile => organization) - submission = create(UploadedFile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => organization, :parent => work_assignment, :last_changed_by => author) + submission = create(UploadedFile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => organization, :parent => work_assignment, :created_by => author) author_folder = work_assignment.find_or_create_author_folder(author) assert_equal author_folder, submission.parent diff --git a/plugins/work_assignment/test/unit/work_assingment_plugin_test.rb b/plugins/work_assignment/test/unit/work_assingment_plugin_test.rb index f2ebac5..07ed37c 100644 --- a/plugins/work_assignment/test/unit/work_assingment_plugin_test.rb +++ b/plugins/work_assignment/test/unit/work_assingment_plugin_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class WorkAssignmentPluginTest < ActiveSupport::TestCase should 'verify if a content is a work_assignment submission' do organization = fast_create(Organization) - content = create(UploadedFile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => organization, :last_changed_by => fast_create(Person)) + content = create(UploadedFile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => organization, :created_by => fast_create(Person)) assert !WorkAssignmentPlugin.is_submission?(content) work_assignment = WorkAssignmentPlugin::WorkAssignment.create!(:name => 'Work Assignment', :profile => organization) @@ -46,9 +46,11 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase private def create_submission(author=nil) + author ||= fast_create(Person) organization = fast_create(Organization) + work_assignment = WorkAssignmentPlugin::WorkAssignment.create!(:name => 'Work Assignment', :profile => organization) - author_folder = work_assignment.find_or_create_author_folder(fast_create(Person)) - create(UploadedFile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => organization, :parent => author_folder, :last_changed_by => author) + author_folder = work_assignment.find_or_create_author_folder(author) + create(UploadedFile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => organization, :parent => author_folder, :created_by => author) end end -- libgit2 0.21.2