@@ -44,35 +44,6 class ProjectTest < ActiveSupport::TestCase | |||||
44 | User.current = nil |
|
44 | User.current = nil | |
45 | end |
|
45 | end | |
46 |
|
46 | |||
47 | should_validate_presence_of :name |
|
|||
48 | should_validate_presence_of :identifier |
|
|||
49 |
|
||||
50 | should_validate_uniqueness_of :identifier |
|
|||
51 |
|
||||
52 | context "associations" do |
|
|||
53 | should_have_many :members |
|
|||
54 | should_have_many :users, :through => :members |
|
|||
55 | should_have_many :member_principals |
|
|||
56 | should_have_many :principals, :through => :member_principals |
|
|||
57 | should_have_many :enabled_modules |
|
|||
58 | should_have_many :issues |
|
|||
59 | should_have_many :issue_changes, :through => :issues |
|
|||
60 | should_have_many :versions |
|
|||
61 | should_have_many :time_entries |
|
|||
62 | should_have_many :queries |
|
|||
63 | should_have_many :documents |
|
|||
64 | should_have_many :news |
|
|||
65 | should_have_many :issue_categories |
|
|||
66 | should_have_many :boards |
|
|||
67 | should_have_many :changesets, :through => :repository |
|
|||
68 |
|
||||
69 | should_have_one :repository |
|
|||
70 | should_have_one :wiki |
|
|||
71 |
|
||||
72 | should_have_and_belong_to_many :trackers |
|
|||
73 | should_have_and_belong_to_many :issue_custom_fields |
|
|||
74 | end |
|
|||
75 |
|
||||
76 | def test_truth |
|
47 | def test_truth | |
77 | assert_kind_of Project, @ecookbook |
|
48 | assert_kind_of Project, @ecookbook | |
78 | assert_equal "eCookbook", @ecookbook.name |
|
49 | assert_equal "eCookbook", @ecookbook.name |
@@ -530,8 +530,6 class UserTest < ActiveSupport::TestCase | |||||
530 | assert_equal 1, anon2.errors.count |
|
530 | assert_equal 1, anon2.errors.count | |
531 | end |
|
531 | end | |
532 |
|
532 | |||
533 | should_have_one :rss_token |
|
|||
534 |
|
||||
535 | def test_rss_key |
|
533 | def test_rss_key | |
536 | assert_nil @jsmith.rss_token |
|
534 | assert_nil @jsmith.rss_token | |
537 | key = @jsmith.rss_key |
|
535 | key = @jsmith.rss_key | |
@@ -541,9 +539,6 class UserTest < ActiveSupport::TestCase | |||||
541 | assert_equal key, @jsmith.rss_key |
|
539 | assert_equal key, @jsmith.rss_key | |
542 | end |
|
540 | end | |
543 |
|
541 | |||
544 |
|
||||
545 | should_have_one :api_token |
|
|||
546 |
|
||||
547 | context "User#api_key" do |
|
542 | context "User#api_key" do | |
548 | should "generate a new one if the user doesn't have one" do |
|
543 | should "generate a new one if the user doesn't have one" do | |
549 | user = User.generate_with_protected!(:api_token => nil) |
|
544 | user = User.generate_with_protected!(:api_token => nil) |
General Comments 0
You need to be logged in to leave comments.
Login now