Revision 424:b601a9e472f3 vendor

View differences:

vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
22 22
    bibtex_entry = params[:bibtex_entry]
23 23

  
24 24
    # method for creating "pasted" bibtex entries
25
    if bibtex_entry      
25
    if bibtex_entry
26
      logger.error "ANTES PARSE"      
26 27
      parse_bibtex_list bibtex_entry    
28
      logger.error "DEPOIS PARSE"
27 29
    end
28 30

  
29 31
    # form's flow control
......
110 112
    @publication.bibtex_entry = @bentry
111 113
    @publication.save
112 114

  
113
    @created_publications << @publication.id
115
    # what is this for??? 
116
    # @created_publications << @publication.id
114 117

  
115 118
    # need to save all authors
116 119
    #   and establish the author-publication association 
vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb
1 1
<h2>Publications#index</h2>
2 2

  
3

  
4
<table>
5
  <tr>
6
    <th>Number</th>
7
    <th>Title</th> 
8
  </tr>
9

  
3 10
<% @publications.each do |publication| %>
4
	
5
	<p><%= publication.id %>: <%=publication.title %></p>
11
	<tr>
12
	  <td><%= publication.id %></td>
13
	  <td><%= publication.title %></td>
14
	 	</tr>
6 15
	
7 16
<% end %>
vendor/plugins/redmine_bibliography/test/fixtures/authors.yml
1 1
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2 2
one:
3 3
  id: 1
4
  user_id: 1
5
  firstname: MyString
6
  lastname: MyString
4
  user_id: 
5
  name: MyString
7 6
two:
8 7
  id: 2
9
  user_id: 1
10
  firstname: MyString
11
  lastname: MyString
8
  user_id: 
9
  name: MyString
10
one:
11
  id: 3
12
  user_id: 
13
  name: MyString
14
two:
15
  id: 4
16
  user_id: 
17
  name: MyString
vendor/plugins/redmine_bibliography/test/fixtures/authorships.yml
1 1
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2 2
one:
3 3
  id: 1
4
  author_id: 
5
  publication_id: 
6
  name_on_paper: 
7
  order: 
4
  author_id: 1
5
  publication_id: 1
6
  name_on_paper: Yih-Farn R. Chen
7
  order: 1
8 8
  institution: 
9 9
  email: MyString
10 10
two:
11 11
  id: 2
12
  author_id: 
13
  publication_id: 
14
  name_on_paper: 
15
  order: 
12
  author_id: 2
13
  publication_id: 1
14
  name_on_paper: Glenn S. Fowler
15
  order: 2
16 16
  institution: 
17 17
  email: MyString
18
three:
19
  id: 3
20
  author_id: 1
21
  publication_id: 1
22
  name_on_paper: Yih-Farn R. Chen
23
  order: 1
24
  institution: 
25
  email: MyString
26
four:
27
  id: 4
28
  author_id: 2
29
  publication_id: 1
30
  name_on_paper: Glenn S. Fowler
31
  order: 2
32
  institution: 
33
  email: MyString
vendor/plugins/redmine_bibliography/test/fixtures/bibtex_entries.yml
1 1
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2 2
one:
3 3
  id: 1
4
  entry_type: 
5
  address: 
6
  annote: 
7
  booktitle: 
8
  chapter: 
9
  crossref: 
10
  edition: 
11
  editor: 
12
  eprint: 
13
  howpublished: 
14
  journal: 
15
  key: 
16
  month: 
17
  note: 
18
  number: 
19
  organization: 
20
  pages: 
21
  publisher: 
22
  school: 
23
  series: 
24
  type: 
25
  url: 
26
  volume: 
27
  year: 1
28
two:
29
  id: 2
30
  entry_type: 
31
  address: 
32
  annote: 
33
  booktitle: 
34
  chapter: 
35
  crossref: 
36
  edition: 
37
  editor: 
38
  eprint: 
39
  howpublished: 
40
  journal: 
41
  key: 
42
  month: 
43
  note: 
44
  number: 
45
  organization: 
46
  pages: 
47
  publisher: 
48
  school: 
49
  series: 
50
  type: 
51
  url: 
52
  volume: 
53
  year: 1
4
  entry_type: InProceedings
5
  booktitle: International Conference on Software Maintenance
6
  year: 1995
vendor/plugins/redmine_bibliography/test/fixtures/publications.yml
1 1
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2 2
one:
3 3
  id: 1
4
  title: MyString
5
  bibtex_entry_id: MyString
4
  title: Test Fixture Title No1
5
  bibtex_entry_id: 1
6 6
two:
7 7
  id: 2
8 8
  title: MyString
vendor/plugins/redmine_bibliography/test/test_helper.rb
1 1
# Load the normal Rails helper
2 2
require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper')
3
require 'publications_controller'
3 4

  
4 5
# Ensure that we are using the temporary fixture path
5 6
Engines::Testing.set_fixture_path
7

  
8
class PublicationsControllerTest < ActionController::TestCase
9
  fixtures :publications, :authors, :bibtex_entries, :authorships
10

  
11
  def setup
12
  end
13

  
14
  def test_routing
15
    assert_routing(
16
        )
17
  end

Also available in: Unified diff