Commit a4cd738686659314f0bb9fd13a80845dc2b036ab

Authored by Andrey Kumanyaev
1 parent df7c5248

tests fix

spec/models/group_spec.rb
... ... @@ -20,5 +20,5 @@ describe Group do
20 20 it { should validate_uniqueness_of(:name) }
21 21 it { should validate_presence_of :code }
22 22 it { should validate_uniqueness_of(:code) }
23   - it { should validate_presence_of :owner_id }
  23 + it { should validate_presence_of :owner }
24 24 end
... ...
spec/models/milestone_spec.rb
... ... @@ -12,7 +12,7 @@ describe Milestone do
12 12  
13 13 describe "Validation" do
14 14 it { should validate_presence_of(:title) }
15   - it { should validate_presence_of(:project_id) }
  15 + it { should validate_presence_of(:project) }
16 16 it { should ensure_inclusion_of(:closed).in_array([true, false]) }
17 17 end
18 18  
... ...
spec/models/protected_branch_spec.rb
... ... @@ -10,7 +10,7 @@ describe ProtectedBranch do
10 10 end
11 11  
12 12 describe 'Validation' do
13   - it { should validate_presence_of(:project_id) }
  13 + it { should validate_presence_of(:project) }
14 14 it { should validate_presence_of(:name) }
15 15 end
16 16  
... ...
spec/models/snippet_spec.rb
... ... @@ -13,8 +13,8 @@ describe Snippet do
13 13 end
14 14  
15 15 describe "Validation" do
16   - it { should validate_presence_of(:author_id) }
17   - it { should validate_presence_of(:project_id) }
  16 + it { should validate_presence_of(:author) }
  17 + it { should validate_presence_of(:project) }
18 18  
19 19 it { should validate_presence_of(:title) }
20 20 it { should ensure_length_of(:title).is_within(0..255) }
... ...
spec/models/users_project_spec.rb
... ... @@ -13,10 +13,10 @@ describe UsersProject do
13 13 describe "Validation" do
14 14 let!(:users_project) { create(:users_project) }
15 15  
16   - it { should validate_presence_of(:user_id) }
  16 + it { should validate_presence_of(:user) }
17 17 it { should validate_uniqueness_of(:user_id).scoped_to(:project_id).with_message(/already exists/) }
18 18  
19   - it { should validate_presence_of(:project_id) }
  19 + it { should validate_presence_of(:project) }
20 20 end
21 21  
22 22 describe "Delegate methods" do
... ...
spec/models/wiki_spec.rb
... ... @@ -16,6 +16,6 @@ describe Wiki do
16 16 it { should validate_presence_of(:title) }
17 17 it { should ensure_length_of(:title).is_within(1..250) }
18 18 it { should validate_presence_of(:content) }
19   - it { should validate_presence_of(:user_id) }
  19 + it { should validate_presence_of(:user) }
20 20 end
21 21 end
... ...
spec/roles/issue_commonality_spec.rb
... ... @@ -11,8 +11,8 @@ describe Issue, "IssueCommonality" do
11 11 end
12 12  
13 13 describe "Validation" do
14   - it { should validate_presence_of(:project_id) }
15   - it { should validate_presence_of(:author_id) }
  14 + it { should validate_presence_of(:project) }
  15 + it { should validate_presence_of(:author) }
16 16 it { should validate_presence_of(:title) }
17 17 it { should ensure_length_of(:title).is_at_least(0).is_at_most(255) }
18 18 end
... ...