changeset 1370:0b169a5e3837 bibliography_testing

Copied the user test fixtures to the plugin test folder; tests are now running.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 21 Aug 2013 18:57:34 +0100
parents 40e64d14e691
children a8d468e143f7
files plugins/redmine_bibliography/test/fixtures/authors.yml plugins/redmine_bibliography/test/fixtures/authorships.yml plugins/redmine_bibliography/test/fixtures/users.yml plugins/redmine_bibliography/test/functional/authors_controller_test.rb plugins/redmine_bibliography/test/test_helper.rb plugins/redmine_bibliography/test/unit/author_test.rb plugins/redmine_bibliography/test/unit/authorship_test.rb
diffstat 7 files changed, 194 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/redmine_bibliography/test/fixtures/authors.yml	Wed Aug 21 17:51:08 2013 +0100
+++ b/plugins/redmine_bibliography/test/fixtures/authors.yml	Wed Aug 21 18:57:34 2013 +0100
@@ -1,17 +1,17 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 one:
   id: 1
-  user_id: 
-  name: MyString
+  user_id: 1
+  name: Luis
 two:
   id: 2
-  user_id: 
-  name: MyString
-one:
+  user_id:
+  name: Manel
+three:
   id: 3
-  user_id: 
-  name: MyString
-two:
+  user_id:
+  name: MyString1
+four:
   id: 4
-  user_id: 
-  name: MyString
+  user_id:
+  name: MyString2
--- a/plugins/redmine_bibliography/test/fixtures/authorships.yml	Wed Aug 21 17:51:08 2013 +0100
+++ b/plugins/redmine_bibliography/test/fixtures/authorships.yml	Wed Aug 21 18:57:34 2013 +0100
@@ -5,7 +5,7 @@
   publication_id: 1
   name_on_paper: Yih-Farn R. Chen
   order: 1
-  institution: 
+  institution:
   email: MyString
 two:
   id: 2
@@ -13,7 +13,7 @@
   publication_id: 1
   name_on_paper: Glenn S. Fowler
   order: 2
-  institution: 
+  institution:
   email: MyString
 three:
   id: 3
@@ -21,7 +21,7 @@
   publication_id: 1
   name_on_paper: Yih-Farn R. Chen
   order: 1
-  institution: 
+  institution:
   email: MyString
 four:
   id: 4
@@ -29,5 +29,5 @@
   publication_id: 1
   name_on_paper: Glenn S. Fowler
   order: 2
-  institution: 
+  institution:
   email: MyString
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/redmine_bibliography/test/fixtures/users.yml	Wed Aug 21 18:57:34 2013 +0100
@@ -0,0 +1,166 @@
+--- 
+users_004: 
+  created_on: 2006-07-19 19:34:07 +02:00
+  status: 1
+  last_login_on: 
+  language: en
+  # password = foo
+  salt: 3126f764c3c5ac61cbfc103f25f934cf
+  hashed_password: 9e4dd7eeb172c12a0691a6d9d3a269f7e9fe671b
+  updated_on: 2006-07-19 19:34:07 +02:00
+  admin: false
+  mail: rhill@somenet.foo
+  lastname: Hill
+  firstname: Robert
+  id: 4
+  auth_source_id: 
+  mail_notification: all
+  login: rhill
+  type: User
+users_001: 
+  created_on: 2006-07-19 19:12:21 +02:00
+  status: 1
+  last_login_on: 2006-07-19 22:57:52 +02:00
+  language: en
+  # password = admin
+  salt: 82090c953c4a0000a7db253b0691a6b4
+  hashed_password: b5b6ff9543bf1387374cdfa27a54c96d236a7150
+  updated_on: 2006-07-19 22:57:52 +02:00
+  admin: true
+  mail: admin@somenet.foo
+  lastname: Admin
+  firstname: redMine
+  id: 1
+  auth_source_id: 
+  mail_notification: all
+  login: admin
+  type: User
+users_002: 
+  created_on: 2006-07-19 19:32:09 +02:00
+  status: 1
+  last_login_on: 2006-07-19 22:42:15 +02:00
+  language: en
+  # password = jsmith
+  salt: 67eb4732624d5a7753dcea7ce0bb7d7d
+  hashed_password: bfbe06043353a677d0215b26a5800d128d5413bc
+  updated_on: 2006-07-19 22:42:15 +02:00
+  admin: false
+  mail: jsmith@somenet.foo
+  lastname: Smith
+  firstname: John
+  id: 2
+  auth_source_id: 
+  mail_notification: all
+  login: jsmith
+  type: User
+users_003: 
+  created_on: 2006-07-19 19:33:19 +02:00
+  status: 1
+  last_login_on: 
+  language: en
+  # password = foo
+  salt: 7599f9963ec07b5a3b55b354407120c0
+  hashed_password: 8f659c8d7c072f189374edacfa90d6abbc26d8ed
+  updated_on: 2006-07-19 19:33:19 +02:00
+  admin: false
+  mail: dlopper@somenet.foo
+  lastname: Lopper
+  firstname: Dave
+  id: 3
+  auth_source_id: 
+  mail_notification: all
+  login: dlopper
+  type: User
+users_005: 
+  id: 5
+  created_on: 2006-07-19 19:33:19 +02:00
+  # Locked
+  status: 3
+  last_login_on: 
+  language: en
+  hashed_password: 1
+  updated_on: 2006-07-19 19:33:19 +02:00
+  admin: false
+  mail: dlopper2@somenet.foo
+  lastname: Lopper2
+  firstname: Dave2
+  auth_source_id: 
+  mail_notification: all
+  login: dlopper2
+  type: User
+users_006: 
+  id: 6
+  created_on: 2006-07-19 19:33:19 +02:00
+  status: 0
+  last_login_on: 
+  language: ''
+  hashed_password: 1
+  updated_on: 2006-07-19 19:33:19 +02:00
+  admin: false
+  mail: ''
+  lastname: Anonymous
+  firstname: ''
+  auth_source_id: 
+  mail_notification: only_my_events
+  login: ''
+  type: AnonymousUser
+users_007: 
+  id: 7
+  created_on: 2006-07-19 19:33:19 +02:00
+  status: 1
+  last_login_on: 
+  language: ''
+  hashed_password: 1
+  updated_on: 2006-07-19 19:33:19 +02:00
+  admin: false
+  mail: someone@foo.bar
+  lastname: One
+  firstname: Some
+  auth_source_id: 
+  mail_notification: only_my_events
+  login: someone
+  type: User
+users_008: 
+  id: 8
+  created_on: 2006-07-19 19:33:19 +02:00
+  status: 1
+  last_login_on: 
+  language: 'it'
+  # password = foo
+  salt: 7599f9963ec07b5a3b55b354407120c0
+  hashed_password: 8f659c8d7c072f189374edacfa90d6abbc26d8ed
+  updated_on: 2006-07-19 19:33:19 +02:00
+  admin: false
+  mail: miscuser8@foo.bar
+  lastname: Misc
+  firstname: User
+  auth_source_id: 
+  mail_notification: only_my_events
+  login: miscuser8
+  type: User
+users_009: 
+  id: 9
+  created_on: 2006-07-19 19:33:19 +02:00
+  status: 1
+  last_login_on: 
+  language: 'it'
+  hashed_password: 1
+  updated_on: 2006-07-19 19:33:19 +02:00
+  admin: false
+  mail: miscuser9@foo.bar
+  lastname: Misc
+  firstname: User
+  auth_source_id: 
+  mail_notification: only_my_events
+  login: miscuser9
+  type: User
+groups_010: 
+  id: 10
+  lastname: A Team
+  type: Group
+groups_011: 
+  id: 11
+  lastname: B Team
+  type: Group
+
+  
--- a/plugins/redmine_bibliography/test/functional/authors_controller_test.rb	Wed Aug 21 17:51:08 2013 +0100
+++ b/plugins/redmine_bibliography/test/functional/authors_controller_test.rb	Wed Aug 21 18:57:34 2013 +0100
@@ -1,8 +1,11 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
 
 class AuthorsControllerTest < ActionController::TestCase
-  # Replace this with your real tests.
-  def test_truth
-    assert true
+  self.fixture_path = File.dirname(__FILE__) + "/../fixtures/"
+  fixtures :users, :authors
+
+  def test_users_authors_relationship
+    assert Author.first.user.name == "redMine Admin"
   end
+
 end
--- a/plugins/redmine_bibliography/test/test_helper.rb	Wed Aug 21 17:51:08 2013 +0100
+++ b/plugins/redmine_bibliography/test/test_helper.rb	Wed Aug 21 18:57:34 2013 +0100
@@ -14,6 +14,8 @@
   end
 
   def test_publication
+    pub = Publication.first
+
     assert 1 == 0
   end
 
--- a/plugins/redmine_bibliography/test/unit/author_test.rb	Wed Aug 21 17:51:08 2013 +0100
+++ b/plugins/redmine_bibliography/test/unit/author_test.rb	Wed Aug 21 18:57:34 2013 +0100
@@ -5,6 +5,8 @@
 
   # Replace this with your real tests.
   def test_truth
+    luis = Author.first
+
     assert true
   end
 end
--- a/plugins/redmine_bibliography/test/unit/authorship_test.rb	Wed Aug 21 17:51:08 2013 +0100
+++ b/plugins/redmine_bibliography/test/unit/authorship_test.rb	Wed Aug 21 18:57:34 2013 +0100
@@ -5,6 +5,9 @@
 
   # Replace this with your real tests.
   def test_truth
+        luis = Author.first
+
+
     assert true
   end