Make milestone's description a required attribute
This commit is contained in:
@@ -10,12 +10,14 @@ class Budget
|
||||
belongs_to :investment
|
||||
|
||||
validates :title, presence: true
|
||||
validates :description, presence: true
|
||||
validates :investment, presence: true
|
||||
validates :publication_date, presence: true
|
||||
|
||||
def self.title_max_length
|
||||
80
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,6 +14,11 @@ describe "Budget::Investment::Milestone" do
|
||||
expect(milestone).to_not be_valid
|
||||
end
|
||||
|
||||
it "Should not be valid without a description" do
|
||||
milestone.description = nil
|
||||
expect(milestone).to_not be_valid
|
||||
end
|
||||
|
||||
it "Should not be valid without an investment" do
|
||||
milestone.investment_id = nil
|
||||
expect(milestone).to_not be_valid
|
||||
|
||||
Reference in New Issue
Block a user