Commit a4cd738686659314f0bb9fd13a80845dc2b036ab

Authored by Andrey Kumanyaev
1 parent df7c5248

tests fix

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