summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2009-10-19 00:27:13 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2009-10-19 00:27:13 +0000
commit61c09b64426981a6da16e5fcd42ab4b796a46f05 (patch)
tree5dc38bab027683ea653fa1cff3604795c4bed79a /test/unit
parent257c92f8f910dd637173b922d10c54e95ac62205 (diff)
downloadredmine-61c09b64426981a6da16e5fcd42ab4b796a46f05.tar.gz
redmine-61c09b64426981a6da16e5fcd42ab4b796a46f05.zip
Added shoulda macros to test Project's associations
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2936 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/project_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index 6f985cb13..fa163cfad 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -34,6 +34,30 @@ class ProjectTest < ActiveSupport::TestCase
should_validate_uniqueness_of :name
should_validate_uniqueness_of :identifier
+ context "associations" do
+ should_have_many :members
+ should_have_many :users, :through => :members
+ should_have_many :member_principals
+ should_have_many :principals, :through => :member_principals
+ should_have_many :enabled_modules
+ should_have_many :issues
+ should_have_many :issue_changes, :through => :issues
+ should_have_many :versions
+ should_have_many :time_entries
+ should_have_many :queries
+ should_have_many :documents
+ should_have_many :news
+ should_have_many :issue_categories
+ should_have_many :boards
+ should_have_many :changesets, :through => :repository
+
+ should_have_one :repository
+ should_have_one :wiki
+
+ should_have_and_belong_to_many :trackers
+ should_have_and_belong_to_many :issue_custom_fields
+ end
+
def test_truth
assert_kind_of Project, @ecookbook
assert_equal "eCookbook", @ecookbook.name