Commit a4cd7386 authored by Andrey Kumanyaev's avatar Andrey Kumanyaev

tests fix

parent df7c5248
......@@ -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
......@@ -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
......
......@@ -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
......
......@@ -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) }
......
......@@ -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
......
......@@ -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
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment