From 37fb4e96ddcc114ab3a5cb80ecfeaff19c2bf558 Mon Sep 17 00:00:00 2001 From: Mauricio Giacomini Girardello <mgg12@inf.ufpr.br> Date: Mon, 11 Apr 2016 11:55:35 -0300 Subject: [PATCH] adding some fixtures and testing social methods in learning object model --- test/fixtures/languages.yml | 3 +++ test/fixtures/learning_objects.yml | 12 ++++++++++++ test/fixtures/object_types.yml | 3 +++ test/models/learning_object_test.rb | 17 +++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 test/fixtures/languages.yml create mode 100644 test/fixtures/object_types.yml diff --git a/test/fixtures/languages.yml b/test/fixtures/languages.yml new file mode 100644 index 00000000..bec61bf3 --- /dev/null +++ b/test/fixtures/languages.yml @@ -0,0 +1,3 @@ +portuguese: + name: 'Português' + code: 'pt_BR' \ No newline at end of file diff --git a/test/fixtures/learning_objects.yml b/test/fixtures/learning_objects.yml index 369e22d2..85cd38f4 100644 --- a/test/fixtures/learning_objects.yml +++ b/test/fixtures/learning_objects.yml @@ -1,3 +1,15 @@ one: name: 'Object 1' description: 'Testing' + +user_lo: + name: 'Object 1' + description: 'Testing' + author: 'Mauricio' + publisher: john (User) + +institution_lo: + name: 'Institution Object 1' + description: 'Testing' + author: 'Mauricio' + publisher: ufpr (Institution) \ No newline at end of file diff --git a/test/fixtures/object_types.yml b/test/fixtures/object_types.yml new file mode 100644 index 00000000..cbe376bc --- /dev/null +++ b/test/fixtures/object_types.yml @@ -0,0 +1,3 @@ +image: + name: 'Imagem' + mime_type: 'image/jpg' \ No newline at end of file diff --git a/test/models/learning_object_test.rb b/test/models/learning_object_test.rb index 5f2eb280..93858d3c 100644 --- a/test/models/learning_object_test.rb +++ b/test/models/learning_object_test.rb @@ -12,4 +12,21 @@ class LearningObjectTest < ActiveSupport::TestCase should belong_to :language should belong_to(:attachment).class_name('LearningObject::Attachment') should belong_to :object_type + + #sociable + should have_many :views + should have_many :downloads + should have_many :likes + should have_many :shares + include ::Portalmec::SociableTests + + protected + + def sociable_object + learning_objects(:user_lo) + end + + def sociable_user + users(:john) + end end -- GitLab