diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index fd7db4b2..5ae40658 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -20,5 +20,5 @@ describe Group do it { should validate_uniqueness_of(:name) } it { should validate_presence_of :code } it { should validate_uniqueness_of(:code) } - it { should validate_presence_of :owner_id } + it { should validate_presence_of :owner } end diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index 9c11a7b1..ef50e012 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -12,7 +12,7 @@ describe Milestone do describe "Validation" do it { should validate_presence_of(:title) } - it { should validate_presence_of(:project_id) } + it { should validate_presence_of(:project) } it { should ensure_inclusion_of(:closed).in_array([true, false]) } end diff --git a/spec/models/protected_branch_spec.rb b/spec/models/protected_branch_spec.rb index 4b292362..c6b09f35 100644 --- a/spec/models/protected_branch_spec.rb +++ b/spec/models/protected_branch_spec.rb @@ -10,7 +10,7 @@ describe ProtectedBranch do end describe 'Validation' do - it { should validate_presence_of(:project_id) } + it { should validate_presence_of(:project) } it { should validate_presence_of(:name) } end diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb index 66c36e51..465612e0 100644 --- a/spec/models/snippet_spec.rb +++ b/spec/models/snippet_spec.rb @@ -13,8 +13,8 @@ describe Snippet do end describe "Validation" do - it { should validate_presence_of(:author_id) } - it { should validate_presence_of(:project_id) } + it { should validate_presence_of(:author) } + it { should validate_presence_of(:project) } it { should validate_presence_of(:title) } it { should ensure_length_of(:title).is_within(0..255) } diff --git a/spec/models/users_project_spec.rb b/spec/models/users_project_spec.rb index a13a08db..a64ff367 100644 --- a/spec/models/users_project_spec.rb +++ b/spec/models/users_project_spec.rb @@ -13,10 +13,10 @@ describe UsersProject do describe "Validation" do let!(:users_project) { create(:users_project) } - it { should validate_presence_of(:user_id) } + it { should validate_presence_of(:user) } it { should validate_uniqueness_of(:user_id).scoped_to(:project_id).with_message(/already exists/) } - it { should validate_presence_of(:project_id) } + it { should validate_presence_of(:project) } end describe "Delegate methods" do diff --git a/spec/models/wiki_spec.rb b/spec/models/wiki_spec.rb index 1e27954c..7830c821 100644 --- a/spec/models/wiki_spec.rb +++ b/spec/models/wiki_spec.rb @@ -16,6 +16,6 @@ describe Wiki do it { should validate_presence_of(:title) } it { should ensure_length_of(:title).is_within(1..250) } it { should validate_presence_of(:content) } - it { should validate_presence_of(:user_id) } + it { should validate_presence_of(:user) } end end diff --git a/spec/roles/issue_commonality_spec.rb b/spec/roles/issue_commonality_spec.rb index 77b98b46..fc4114e3 100644 --- a/spec/roles/issue_commonality_spec.rb +++ b/spec/roles/issue_commonality_spec.rb @@ -11,8 +11,8 @@ describe Issue, "IssueCommonality" do end describe "Validation" do - it { should validate_presence_of(:project_id) } - it { should validate_presence_of(:author_id) } + it { should validate_presence_of(:project) } + it { should validate_presence_of(:author) } it { should validate_presence_of(:title) } it { should ensure_length_of(:title).is_at_least(0).is_at_most(255) } end