Revision 1371:a8d468e143f7 plugins/redmine_bibliography/test/unit
| plugins/redmine_bibliography/test/unit/author_test.rb | ||
|---|---|---|
| 1 |
require File.dirname(__FILE__) + '/../test_helper' |
|
| 1 |
# author_test.rb |
|
| 2 |
|
|
| 3 |
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') |
|
| 2 | 4 |
|
| 3 | 5 |
class AuthorTest < ActiveSupport::TestCase |
| 4 |
fixtures :authors |
|
| 6 |
self.fixture_path = File.dirname(__FILE__) + "/../fixtures/" |
|
| 7 |
fixtures :users, :authors, :authorships |
|
| 5 | 8 |
|
| 6 |
# Replace this with your real tests. |
|
| 7 |
def test_truth |
|
| 8 |
luis = Author.first |
|
| 9 |
def test_relationships |
|
| 10 |
author = Author.find(1) |
|
| 11 |
assert author.authorships.first.name_on_paper == "Yih-Farn R. Chen" |
|
| 12 |
end |
|
| 9 | 13 |
|
| 10 |
assert true |
|
| 11 |
end |
|
| 12 | 14 |
end |
| plugins/redmine_bibliography/test/unit/publication_test.rb | ||
|---|---|---|
| 1 |
require File.dirname(__FILE__) + '/../test_helper'
|
|
| 1 |
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
|
| 2 | 2 |
|
| 3 | 3 |
class PublicationTest < ActiveSupport::TestCase |
| 4 |
fixtures :publications
|
|
| 4 |
self.fixture_path = File.dirname(__FILE__) + "/../fixtures/"
|
|
| 5 | 5 |
|
| 6 |
# Replace this with your real tests. |
|
| 7 |
def test_truth |
|
| 8 |
assert true |
|
| 9 |
end |
|
| 6 |
fixtures :publications, :authorships |
|
| 7 |
|
|
| 8 |
# Replace this with your real tests. |
|
| 9 |
def test_truth |
|
| 10 |
assert true |
|
| 11 |
end |
|
| 12 |
|
|
| 13 |
def test_relationships |
|
| 14 |
# test authorships - publication relationship |
|
| 15 |
publication = Publication.find(1) |
|
| 16 |
|
|
| 17 |
assert publication.authorships.count == 4 |
|
| 18 |
end |
|
| 19 |
|
|
| 10 | 20 |
end |
Also available in: Unified diff