Merge master

This commit is contained in:
Michael Ball 2021-03-08 16:48:06 -08:00
commit f3271f5cdc
21 changed files with 58 additions and 37 deletions

View file

@ -10,6 +10,7 @@
# length :integer default(30)
# maximum_abstract_length :integer default(500)
# minimum_abstract_length :integer default(0)
# submission_instructions :text
# title :string not null
# created_at :datetime
# updated_at :datetime
@ -22,6 +23,8 @@ FactoryBot.define do
length { 30 }
minimum_abstract_length { 0 }
maximum_abstract_length { 500 }
description { 'Example Event Description' }
submission_instructions { 'Example Event Instructions' }
color { '#ffffff' }
program
end

View file

@ -7,6 +7,7 @@
# id :bigint not null, primary key
# abstract :text
# comments_count :integer default(0), not null
# committee_review :text
# description :text
# guid :string not null
# is_highlight :boolean default(FALSE)

View file

@ -22,6 +22,8 @@ feature EventType do
fill_in 'event_type_title', with: 'Party'
fill_in 'event_type_length', with: '240'
fill_in 'event_type_description', with: '**Description**'
fill_in 'event_type_submission_instructions', with: '**Instructions**'
fill_in 'event_type_minimum_abstract_length', with: '0'
fill_in 'event_type_maximum_abstract_length', with: '13042'
page.find('#event_type_color').set('#e4e4e4')
@ -29,11 +31,14 @@ feature EventType do
click_button 'Create Event type'
page.find('#flash')
# Validations
# binding.pry
expect(flash).to eq('Event type successfully created.')
within('table#event_types') do
expect(page.has_content?('Party')).to be true
expect(page.has_content?('13042')).to be true
expect(page.has_content?('#E4E4E4')).to be true
expect(page.has_content?('Description')).to be true
expect(page.has_content?('Instructions')).to be true
expect(page.assert_selector('tr', count: 3)).to be true
end

View file

@ -147,11 +147,15 @@ feature Event do
select('Example Event Type', from: 'event[event_type_id]')
expect(page).to have_selector(".in[id='#{find_field('event[event_type_id]').value}-help']") # End of animation
expect(page).to have_text('Example Event Description')
fill_in 'event_abstract', with: 'Lorem ipsum abstract'
expect(page).to have_text('You have used 3 words')
fill_in 'event_submission_text', with: 'Lorem ipsum submission_text'
expect(page).to have_text('Submission description')
expect(page).to have_text('Submission text')
# Submission Instructions content
expect(page).to have_text('Example Event Instructions')
click_link 'Do you require something special?'
fill_in 'event_description', with: 'Lorem ipsum description'

View file

@ -7,6 +7,7 @@
# id :bigint not null, primary key
# abstract :text
# comments_count :integer default(0), not null
# committee_review :text
# description :text
# guid :string not null
# is_highlight :boolean default(FALSE)
@ -116,20 +117,6 @@ describe Event do
event.event_type.minimum_abstract_length = 2
end
context 'is invalid' do
it 'when submission text is too long' do
event.submission_text = 'four too many words'
expect(event.valid?).to eq false
expect(event.errors[:submission_text]).to eq ['cannot have more than 3 words']
end
it 'when submission text is too short' do
event.submission_text = 'word'
expect(event.valid?).to eq false
expect(event.errors[:submission_text]).to eq ['cannot have less than 2 words']
end
end
context 'is valid' do
it 'when submission text is within limts' do
event.abstract = 'the magic three'

View file

@ -10,6 +10,7 @@
# length :integer default(30)
# maximum_abstract_length :integer default(500)
# minimum_abstract_length :integer default(0)
# submission_instructions :text
# title :string not null
# created_at :datetime
# updated_at :datetime

View file

@ -7,6 +7,7 @@
# id :bigint not null, primary key
# abstract :text
# comments_count :integer default(0), not null
# committee_review :text
# description :text
# guid :string not null
# is_highlight :boolean default(FALSE)