Skip to content

Commit

Permalink
create event capybara specs
Browse files Browse the repository at this point in the history
  • Loading branch information
santiago-dev96 committed Jan 23, 2020
1 parent ebf5266 commit 2e609e4
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion spec/system/create_events_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,23 @@
driven_by(:rack_test)
end

pending "add some scenarios (or delete) #{__FILE__}"
it 'creates an event' do
visit(login_path)
fill_in('Name', with: 'bob')
find('input[type="submit"]').click
visit(new_event_path)
expect(page).to have_current_path(new_event_path)
expect(page).to have_content('Description')
expect(page).to have_selector('form input[name="event[description]"')
expect(page).to have_selector('form input[type="text"')
expect(page).to have_content('Date')
expect(page).to have_selector('form input[type="date"]')
expect(page).to have_selector('form input[type="submit"]')
fill_in('Description', with: 'party')
fill_in('Date', with: '2020-01-25')
count = Event.count
click_on('Create Event')
expect(Event.count).to eq(count + 1)
expect(page).to have_current_path(event_path(Event.last))
end
end

0 comments on commit 2e609e4

Please sign in to comment.