Revision 1372:a8832968d927 plugins/redmine_bibliography/test
| plugins/redmine_bibliography/test/fixtures/authorships.yml | ||
|---|---|---|
| 7 | 7 |
name_on_paper: Yih-Farn R. Chen |
| 8 | 8 |
auth_order: 1 |
| 9 | 9 |
institution: Imperial College London |
| 10 |
email: MyString
|
|
| 10 |
email: chen@imperial.ac.uk
|
|
| 11 | 11 |
two: |
| 12 | 12 |
id: 2 |
| 13 | 13 |
author_id: 2 |
| ... | ... | |
| 20 | 20 |
id: 3 |
| 21 | 21 |
author_id: 3 |
| 22 | 22 |
publication_id: 1 |
| 23 |
name_on_paper: Yih-Farn R. Chen
|
|
| 23 |
name_on_paper: Jackie Brown
|
|
| 24 | 24 |
auth_order: 1 |
| 25 | 25 |
institution: |
| 26 |
email: MyString
|
|
| 26 |
email: j.brown@m.com
|
|
| 27 | 27 |
four: |
| 28 | 28 |
id: 4 |
| 29 | 29 |
author_id: 4 |
| 30 | 30 |
publication_id: 1 |
| 31 |
name_on_paper: Glenn S. Fowler
|
|
| 31 |
name_on_paper: Captain Boomtime
|
|
| 32 | 32 |
auth_order: 2 |
| 33 | 33 |
institution: |
| 34 |
email: MyString |
|
| 34 |
email: cpt.boom@time.co.uk |
|
| 35 |
five: |
|
| 36 |
id: 5 |
|
| 37 |
author_id: 1 |
|
| 38 |
publication_id: 2 |
|
| 39 |
name_on_paper: Yih-Farn Chen |
|
| 40 |
auth_order: 1 |
|
| 41 |
institution: "Imperial College, London" |
|
| 42 |
email: yfc@gmail.com |
|
| plugins/redmine_bibliography/test/fixtures/bibtex_entries.yml | ||
|---|---|---|
| 1 |
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html |
|
| 1 |
# bibtex_entries.yml |
|
| 2 |
--- |
|
| 2 | 3 |
one: |
| 3 | 4 |
id: 1 |
| 4 | 5 |
entry_type: InProceedings |
| plugins/redmine_bibliography/test/unit/author_test.rb | ||
|---|---|---|
| 8 | 8 |
|
| 9 | 9 |
def test_relationships |
| 10 | 10 |
author = Author.find(1) |
| 11 |
assert author.authorships.first.name_on_paper == "Yih-Farn R. Chen" |
|
| 11 |
|
|
| 12 |
assert_equal(author.authorships.first.name_on_paper, "Yih-Farn R. Chen") |
|
| 13 |
assert_equal(author.authorships.count, 2) |
|
| 14 |
|
|
| 12 | 15 |
end |
| 13 | 16 |
|
| 14 | 17 |
end |
Also available in: Unified diff