Skip to content

Commit

Permalink
Adds feature spec for admin creating a virtual event
Browse files Browse the repository at this point in the history
  • Loading branch information
matyikriszta committed Oct 31, 2022
1 parent c642833 commit b5c9b03
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/partials/_layout.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "partials/colors";

#top {
margin-top: 82px;
margin-top: 96px;
}

.main-footer {
Expand Down
33 changes: 33 additions & 0 deletions spec/features/admin/event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,39 @@
end
end

describe 'can successfully create a virtual event' do
scenario 'when they fill in all mandatory fields' do
sponsor = Fabricate(:sponsor)
date = Time.zone.today + 2.days
visit new_admin_event_path

fill_in 'Event Name', with: 'A test virtual event'
fill_in 'Slug', with: 'a-test-virtual-event'
fill_in 'Date', with: date
fill_in 'Begins at', with: '16:00'
fill_in 'Ends at', with: '18:00'
fill_in 'Description', with: 'A test virtual event description'
fill_in 'RSVP instructions', with: 'Some instructions'
fill_in 'Schedule', with: '9:00 Sign up & breakfast <br/> 9:30 kick off'
fill_in 'Coach spaces', with: '19'
fill_in 'Student spaces', with: '25'
check 'This is a virtual event'
click_on 'Save'

expect(page).to have_content('Event successfully created')

expect(page).to have_content('A test virtual event')
expect(page).to have_content(humanize_date(date))
expect(page).to have_content('A test virtual event description')
expect(page).to have_content('25 student spots, 19 coach spots')
expect(page).to have_content('9:00 Sign up & breakfast 9:30 kick off')

within '#host' do
expect(page).to have_content('This is a virtual event.')
end
end
end

describe 'can not create an event' do
scenario 'when they don\'t fill in any of the events details' do
visit new_admin_event_path
Expand Down

0 comments on commit b5c9b03

Please sign in to comment.