[#1092] fixed
This commit is contained in:
parent
8335aa8b43
commit
693798b3f4
3 changed files with 8 additions and 3 deletions
|
|
@ -30,7 +30,6 @@ class Event < ActiveRecord::Base
|
|||
validate :abstract_limit
|
||||
validate :before_end_of_conference, on: :create
|
||||
validates :title, presence: true
|
||||
validates :abstract, presence: true
|
||||
validates :event_type, presence: true
|
||||
validates :program, presence: true
|
||||
validates :max_attendees, numericality: { only_integer: true, greater_than_or_equal_to: 1, allow_nil: true }
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
:javascript
|
||||
$("##{@program.event_types.first.id}-help").collapse('show');
|
||||
|
||||
= f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown-editable' } },
|
||||
= f.input :abstract, input_html: { rows: 5, data: { provide: 'markdown-editable' } },
|
||||
hint: markdown_hint(link_to('Tips to improve your presentations.', 'http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx'))
|
||||
|
||||
%p
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ describe Event do
|
|||
end
|
||||
|
||||
it { is_expected.to validate_presence_of(:title) }
|
||||
it { is_expected.to validate_presence_of(:abstract) }
|
||||
it { is_expected.to validate_presence_of(:program) }
|
||||
it { is_expected.to validate_presence_of(:event_type) }
|
||||
|
||||
|
|
@ -75,6 +74,13 @@ describe Event do
|
|||
expect(event.valid?).to eq true
|
||||
expect(event.errors.size).to eq 0
|
||||
end
|
||||
|
||||
it 'when abstract is empty and minimum_abstract_length equal to zero' do
|
||||
event.abstract = ''
|
||||
event.event_type.minimum_abstract_length = 0
|
||||
expect(event.valid?).to eq true
|
||||
expect(event.errors.size).to eq 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue