starting with events, tied to profiles (not accounts)

This commit is contained in:
2023-01-16 14:49:45 +02:00
parent 63299d4464
commit cb54951037
19 changed files with 307 additions and 11 deletions

View File

@ -0,0 +1,51 @@
require "application_system_test_case"
class EventsTest < ApplicationSystemTestCase
setup do
@event = events(:one)
end
test "visiting the index" do
visit events_url
assert_selector "h1", text: "Events"
end
test "should create event" do
visit events_url
click_on "New event"
fill_in "End date", with: @event.end_date
fill_in "Name", with: @event.name
fill_in "Picture", with: @event.picture
fill_in "Profile", with: @event.profile_id
fill_in "Start date", with: @event.start_date
fill_in "Text", with: @event.text
click_on "Create Event"
assert_text "Event was successfully created"
click_on "Back"
end
test "should update Event" do
visit event_url(@event)
click_on "Edit this event", match: :first
fill_in "End date", with: @event.end_date
fill_in "Name", with: @event.name
fill_in "Picture", with: @event.picture
fill_in "Profile", with: @event.profile_id
fill_in "Start date", with: @event.start_date
fill_in "Text", with: @event.text
click_on "Update Event"
assert_text "Event was successfully updated"
click_on "Back"
end
test "should destroy Event" do
visit event_url(@event)
click_on "Destroy this event", match: :first
assert_text "Event was successfully destroyed"
end
end