acts_as_citable 4.0.0 → 5.0.0.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +4 -13
  3. data/lib/acts_as_citable/base.rb +1 -1
  4. data/lib/acts_as_citable/version.rb +1 -1
  5. data/lib/acts_as_citable.rb +2 -2
  6. data/test/dummy/log/test.log +260 -8031
  7. metadata +32 -238
  8. data/test/acts_as_citable_test.rb +0 -14
  9. data/test/dummy/README.rdoc +0 -28
  10. data/test/dummy/Rakefile +0 -6
  11. data/test/dummy/app/assets/javascripts/application.js +0 -13
  12. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  13. data/test/dummy/app/controllers/application_controller.rb +0 -10
  14. data/test/dummy/app/controllers/test_controller.rb +0 -11
  15. data/test/dummy/app/helpers/application_helper.rb +0 -2
  16. data/test/dummy/app/models/inherited_record.rb +0 -3
  17. data/test/dummy/app/models/record.rb +0 -4
  18. data/test/dummy/app/models/record_changed_field.rb +0 -6
  19. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  20. data/test/dummy/bin/bundle +0 -3
  21. data/test/dummy/bin/rails +0 -4
  22. data/test/dummy/bin/rake +0 -4
  23. data/test/dummy/config/application.rb +0 -23
  24. data/test/dummy/config/boot.rb +0 -5
  25. data/test/dummy/config/database.yml +0 -23
  26. data/test/dummy/config/environment.rb +0 -5
  27. data/test/dummy/config/environments/development.rb +0 -37
  28. data/test/dummy/config/environments/production.rb +0 -78
  29. data/test/dummy/config/environments/test.rb +0 -41
  30. data/test/dummy/config/initializers/assets.rb +0 -8
  31. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  32. data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
  33. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  34. data/test/dummy/config/initializers/inflections.rb +0 -16
  35. data/test/dummy/config/initializers/mime_types.rb +0 -4
  36. data/test/dummy/config/initializers/session_store.rb +0 -3
  37. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  38. data/test/dummy/config/locales/en.yml +0 -23
  39. data/test/dummy/config/locales/responders.en.yml +0 -12
  40. data/test/dummy/config/routes.rb +0 -3
  41. data/test/dummy/config/secrets.yml +0 -22
  42. data/test/dummy/config.ru +0 -4
  43. data/test/dummy/db/development.sqlite3 +0 -0
  44. data/test/dummy/db/migrate/20130221210429_create_records.rb +0 -10
  45. data/test/dummy/db/migrate/20130221214225_create_record_changed_fields.rb +0 -10
  46. data/test/dummy/db/schema.rb +0 -30
  47. data/test/dummy/db/test.sqlite3 +0 -0
  48. data/test/dummy/lib/application_responder.rb +0 -8
  49. data/test/dummy/log/development.log +0 -32
  50. data/test/dummy/public/404.html +0 -67
  51. data/test/dummy/public/422.html +0 -67
  52. data/test/dummy/public/500.html +0 -66
  53. data/test/dummy/public/favicon.ico +0 -0
  54. data/test/dummy/test/fixtures/record_changed_fields.yml +0 -9
  55. data/test/dummy/test/fixtures/records.yml +0 -9
  56. data/test/dummy/test/functional/test_controller_test.rb +0 -22
  57. data/test/dummy/test/unit/helpers/test_helper_test.rb +0 -4
  58. data/test/dummy/test/unit/inherited_record_test.rb +0 -75
  59. data/test/dummy/test/unit/record_changed_field_test.rb +0 -66
  60. data/test/dummy/test/unit/record_test.rb +0 -67
  61. data/test/test_helper.rb +0 -26
@@ -1,75 +0,0 @@
1
- require 'test_helper'
2
-
3
- class InheritedRecordTest < ActiveSupport::TestCase
4
- test "should be able to create a new Inherited Record" do
5
- rec = InheritedRecord.new(:data => "itemType: book", :format => "csf")
6
- assert_equal "TY - BOOK\nER -\n\n", rec.to_ris
7
- assert_equal "@book{????\n}", rec.to_bibtex
8
- assert_equal "rft.ulr_ver=Z39.88-2004&rft.ctx_ver=Z39.88-2004&rft.rfr_id=info:sid/libraries.nyu.edu:citero&rft_val_fmlt=info:ofi/fmt:kev:mtx:book&rft.genre=book", rec.to_openurl
9
- assert_equal "{\"source\":\"book\",\"book\":{\"title\":null},\"pubtype\":{\"main\":\"pubnonperiodical\"},\"pubnonperiodical\":{},\"contributors\":[]}", rec.to_easybib
10
- end
11
-
12
- test "should check if i can use the Inherited record" do
13
- assert rec = InheritedRecord.new( :data => "data", :format => "from_format")
14
- assert rec.destroy
15
- end
16
-
17
- test "should check to see if format fields are set" do
18
- assert 'format', InheritedRecord.format_field
19
- end
20
-
21
- test "should check to see if Inherited records can be converted" do
22
- rec = InheritedRecord.new(:data => "itemType: book", :format => "csf")
23
- assert rec.respond_to?(:to_ris)
24
- assert rec.respond_to?(:to_bibtex)
25
- assert rec.respond_to?(:to_openurl)
26
- assert rec.respond_to?(:to_csf)
27
- assert rec.respond_to?(:to_easybib)
28
- assert rec.respond_to?(:to_refworks_tagged)
29
- assert rec.respond_to?(:csf)
30
- assert rec.destroy
31
- end
32
-
33
- # test "should work with models inherited acts_as_citable models" do
34
- # rec = InheritedRecord.new(:data => "itemType: book", :format => "csf")
35
- # assert_equal "TY - BOOK\nER -\n\n", rec.to_ris
36
- # assert_equal "@book{????\n}", rec.to_bibtex
37
- # assert_equal "rft.ulr_ver=Z39.88-2004&rft.ctx_ver=Z39.88-2004&rft.rfr_id=info:sid/libraries.nyu.edu:citero&rft_val_fmlt=info:ofi/fmt:kev:mtx:book&rft.genre=book", rec.to_openurl
38
- # assert_equal "{\"source\":\"book\",\"book\":{\"title\":null},\"pubtype\":{\"main\":\"pubnonperiodical\"},\"pubnonperiodical\":{},\"contributors\":[]}", rec.to_easybib
39
- # assert rec.destroy
40
- # end
41
-
42
- test "should check to see if you cannot convert from" do
43
- rec = InheritedRecord.new(:data => "itemType: book", :format => "csf")
44
- assert !rec.respond_to?(:from_ris)
45
- assert !rec.respond_to?(:from_bibtex)
46
- assert !rec.respond_to?(:from_openurl)
47
- assert !rec.respond_to?(:from_csf)
48
- assert !rec.respond_to?(:from_pnx)
49
- end
50
-
51
- test "should raise no method error" do
52
- rec = Record.new(:data => "itemType: book", :format => "csf")
53
- assert_raise NoMethodError do
54
- rec.from_ris
55
- end
56
- assert rec.destroy
57
- end
58
-
59
- test "should be available to convert to" do
60
- rec = InheritedRecord.new(:data => "itemType: book", :format => "csf")
61
- assert_equal "TY - BOOK\nER -\n\n", rec.to_ris
62
- assert_equal "@book{????\n}", rec.to_bibtex
63
- assert_equal "rft.ulr_ver=Z39.88-2004&rft.ctx_ver=Z39.88-2004&rft.rfr_id=info:sid/libraries.nyu.edu:citero&rft_val_fmlt=info:ofi/fmt:kev:mtx:book&rft.genre=book", rec.to_openurl
64
- assert_equal "{\"source\":\"book\",\"book\":{\"title\":null},\"pubtype\":{\"main\":\"pubnonperiodical\"},\"pubnonperiodical\":{},\"contributors\":[]}", rec.to_easybib
65
- assert rec.destroy
66
- end
67
-
68
- test "should be able to convert to an export STYLE" do
69
- rec = InheritedRecord.new(:data => "itemType: book", :format => "csf")
70
- assert_equal "<div class=\"csl-bib-body\">\n <div class=\"csl-entry\"> (n.d.).</div>\n</div>", rec.to_apa
71
- assert_equal "<div class=\"csl-bib-body\">\n <div class=\"csl-entry\"> Print.</div>\n</div>", rec.to_mla
72
- assert_equal "<div class=\"csl-bib-body\">\n\n[CSL STYLE ERROR: reference with no printed form.]\n</div>", rec.to_chicago_author_date
73
- end
74
-
75
- end
@@ -1,66 +0,0 @@
1
- require 'test_helper'
2
-
3
- class RecordChangedFieldTest < ActiveSupport::TestCase
4
- test "should be able to create a new Record with changed fields" do
5
- rec = RecordChangedField.new(:data => "itemType: book", :from_format => "csf")
6
- assert_equal "TY - BOOK\nER -\n\n", rec.to_ris
7
- assert_equal "@book{????\n}", rec.to_bibtex
8
- assert_equal "rft.ulr_ver=Z39.88-2004&rft.ctx_ver=Z39.88-2004&rft.rfr_id=info:sid/libraries.nyu.edu:citero&rft_val_fmlt=info:ofi/fmt:kev:mtx:book&rft.genre=book", rec.to_openurl
9
- assert_equal "{\"source\":\"book\",\"book\":{\"title\":null},\"pubtype\":{\"main\":\"pubnonperiodical\"},\"pubnonperiodical\":{},\"contributors\":[]}", rec.to_easybib
10
- end
11
-
12
- test "should check if i can use the record with changed fields" do
13
- assert rec = RecordChangedField.new( :data => "data", :from_format => "from_format")
14
- assert rec.destroy
15
- end
16
-
17
- test "should check to see if from_format fields are set" do
18
- assert 'from_format', RecordChangedField.format_field
19
- end
20
-
21
- test "should check to see if records with changed fields can be converted" do
22
- rec = RecordChangedField.new(:data => "itemType: book", :from_format => "csf")
23
- assert rec.respond_to?(:to_ris)
24
- assert rec.respond_to?(:to_bibtex)
25
- assert rec.respond_to?(:to_openurl)
26
- assert rec.respond_to?(:to_csf)
27
- assert rec.respond_to?(:to_easybib)
28
- assert rec.respond_to?(:to_refworks_tagged)
29
- assert rec.respond_to?(:csf)
30
- assert rec.destroy
31
- end
32
-
33
- test "should check to see if you cannot convert from" do
34
- rec = RecordChangedField.new(:data => "itemType: book", :from_format => "csf")
35
- assert !rec.respond_to?(:from_ris)
36
- assert !rec.respond_to?(:from_bibtex)
37
- assert !rec.respond_to?(:from_openurl)
38
- assert !rec.respond_to?(:from_csf)
39
- assert !rec.respond_to?(:from_pnx)
40
- end
41
-
42
- test "should raise no method error" do
43
- rec = RecordChangedField.new(:data => "itemType: book", :from_format => "csf")
44
- assert_raise NoMethodError do
45
- rec.from_ris
46
- end
47
- assert rec.destroy
48
- end
49
-
50
- test "should be available to convert to" do
51
- rec = RecordChangedField.new(:data => "itemType: book", :from_format => "csf")
52
- assert_equal "TY - BOOK\nER -\n\n", rec.to_ris
53
- assert_equal "@book{????\n}", rec.to_bibtex
54
- assert_equal "rft.ulr_ver=Z39.88-2004&rft.ctx_ver=Z39.88-2004&rft.rfr_id=info:sid/libraries.nyu.edu:citero&rft_val_fmlt=info:ofi/fmt:kev:mtx:book&rft.genre=book", rec.to_openurl
55
- assert_equal "{\"source\":\"book\",\"book\":{\"title\":null},\"pubtype\":{\"main\":\"pubnonperiodical\"},\"pubnonperiodical\":{},\"contributors\":[]}", rec.to_easybib
56
- assert rec.destroy
57
- end
58
-
59
-
60
- test "should be able to convert to an export STYLE" do
61
- rec = RecordChangedField.new(:data => "itemType: book", :from_format => "csf")
62
- assert_equal "<div class=\"csl-bib-body\">\n <div class=\"csl-entry\"> (n.d.).</div>\n</div>", rec.to_apa
63
- assert_equal "<div class=\"csl-bib-body\">\n <div class=\"csl-entry\"> Print.</div>\n</div>", rec.to_mla
64
- assert_equal "<div class=\"csl-bib-body\">\n\n[CSL STYLE ERROR: reference with no printed form.]\n</div>", rec.to_chicago_author_date
65
- end
66
- end
@@ -1,67 +0,0 @@
1
- require 'test_helper'
2
-
3
- class RecordTest < ActiveSupport::TestCase
4
- test "should be able to create a new Record" do
5
- rec = Record.new(:data => "itemType: book", :format => "csf")
6
- assert_equal "TY - BOOK\nER -\n\n", rec.to_ris
7
- assert_equal "@book{????\n}", rec.to_bibtex
8
- assert_equal "rft.ulr_ver=Z39.88-2004&rft.ctx_ver=Z39.88-2004&rft.rfr_id=info:sid/libraries.nyu.edu:citero&rft_val_fmlt=info:ofi/fmt:kev:mtx:book&rft.genre=book", rec.to_openurl
9
- assert_equal "{\"source\":\"book\",\"book\":{\"title\":null},\"pubtype\":{\"main\":\"pubnonperiodical\"},\"pubnonperiodical\":{},\"contributors\":[]}", rec.to_easybib
10
- end
11
-
12
- test "should check if i can use the record" do
13
- assert rec = Record.new( :data => "data", :format => "from_format")
14
- assert rec.destroy
15
- end
16
-
17
- test "should check to see if format fields are set" do
18
- assert 'format', Record.format_field
19
- end
20
-
21
- test "should check to see if records can be converted" do
22
- rec = Record.new(:data => "itemType: book", :format => "csf")
23
- assert rec.respond_to?(:to_ris)
24
- assert rec.respond_to?(:to_bibtex)
25
- assert rec.respond_to?(:to_openurl)
26
- assert rec.respond_to?(:to_csf)
27
- assert rec.respond_to?(:to_easybib)
28
- assert rec.respond_to?(:to_refworks_tagged)
29
- assert rec.respond_to?(:csf)
30
- assert rec.destroy
31
- end
32
-
33
- test "should check to see if you cannot convert from" do
34
- rec = Record.new(:data => "itemType: book", :format => "csf")
35
- assert !rec.respond_to?(:from_ris)
36
- assert !rec.respond_to?(:from_bibtex)
37
- assert !rec.respond_to?(:from_openurl)
38
- assert !rec.respond_to?(:from_csf)
39
- assert !rec.respond_to?(:from_pnx)
40
- end
41
-
42
- test "should raise no method error" do
43
- rec = Record.new(:data => "itemType: book", :format => "csf")
44
- assert_raise NoMethodError do
45
- rec.from_ris
46
- end
47
- assert rec.destroy
48
- end
49
-
50
- test "should be available to convert to" do
51
- rec = Record.new(:data => "itemType: book", :format => "csf")
52
- assert_equal "TY - BOOK\nER -\n\n", rec.to_ris
53
- assert_equal "@book{????\n}", rec.to_bibtex
54
- assert_equal "rft.ulr_ver=Z39.88-2004&rft.ctx_ver=Z39.88-2004&rft.rfr_id=info:sid/libraries.nyu.edu:citero&rft_val_fmlt=info:ofi/fmt:kev:mtx:book&rft.genre=book", rec.to_openurl
55
- assert_equal "{\"source\":\"book\",\"book\":{\"title\":null},\"pubtype\":{\"main\":\"pubnonperiodical\"},\"pubnonperiodical\":{},\"contributors\":[]}", rec.to_easybib
56
- assert rec.destroy
57
- end
58
-
59
-
60
- test "should be able to convert to an export STYLE" do
61
- rec = Record.new(:data => "itemType: book", :format => "csf")
62
- assert_equal "<div class=\"csl-bib-body\">\n <div class=\"csl-entry\"> (n.d.).</div>\n</div>", rec.to_apa
63
- assert_equal "<div class=\"csl-bib-body\">\n <div class=\"csl-entry\"> Print.</div>\n</div>", rec.to_mla
64
- assert_equal "<div class=\"csl-bib-body\">\n\n[CSL STYLE ERROR: reference with no printed form.]\n</div>", rec.to_chicago_author_date
65
- end
66
-
67
- end
data/test/test_helper.rb DELETED
@@ -1,26 +0,0 @@
1
- unless ENV['TRAVIS']
2
- require 'simplecov'
3
- require 'simplecov-rcov'
4
- SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
5
- SimpleCov.start 'rails'
6
- else
7
- require 'coveralls'
8
- Coveralls.wear!
9
- end
10
-
11
- # Configure Rails Environment
12
- ENV["RAILS_ENV"] = "test"
13
-
14
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
15
- require "rails/test_help"
16
- require "nokogiri"
17
-
18
- Rails.backtrace_cleaner.remove_silencers!
19
-
20
- # Load support files
21
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
22
-
23
- # Load fixtures from the engine
24
- if ActiveSupport::TestCase.method_defined?(:fixture_path=)
25
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
26
- end