view plugins/redmine_bibliography/test/unit/publication_test.rb @ 1423:40e82f170353 biblio_alt_search_auth

small adjustments to text box size.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 02 Oct 2013 16:47:03 +0100
parents 95a6d8cecdb8
children cfa80f738847
line wrap: on
line source
# publication_test

require File.expand_path(File.dirname(__FILE__) + '/../test_helper')

class PublicationTest < ActiveSupport::TestCase
    self.fixture_path = File.dirname(__FILE__) + "/../fixtures/"

    fixtures :publications, :authorships

    # Replace this with your real tests.
    def test_truth
        assert true
    end

    def test_relationships
        # test authorships - publication relationship
        publication = Publication.find(1)

        assert 4, publication.authorships.count
    end

    def test_new_publication_validations
        pub = Publication.create

        assert !pub.valid?, "!pub.valid?"
        assert_equal 2, pub.errors.count, "Number of errors"
        assert_equal ["can't be blank"], pub.errors[:title]
        assert_equal ["Please add at least one author to this publication."], pub.errors[:authorships]
    end

end