budget/test/system/members_test.rb
Andrew Tomaka 108959f2b0
Some checks failed
Ruby CI / test (pull_request) Failing after 40s
Require authentication for most actions
2024-09-08 20:53:07 -04:00

44 lines
991 B
Ruby

require "application_system_test_case"
class MembersTest < ApplicationSystemTestCase
setup do
@member = members(:one)
login(users(:one).email)
end
test "visiting the index" do
visit members_url
assert_selector "h1", text: "Members"
end
test "should create member" do
visit members_url
click_on "New member"
fill_in "Name", with: @member.name
check "Pays" if @member.pays
click_on "Create Member"
assert_text "Member was successfully created"
click_on "Back"
end
test "should update Member" do
visit member_url(@member)
click_on "Edit this member", match: :first
fill_in "Name", with: @member.name
check "Pays" if @member.pays
click_on "Update Member"
assert_text "Member was successfully updated"
click_on "Back"
end
test "should destroy Member" do
visit member_url(@member)
click_on "Destroy this member", match: :first
assert_text "Member was successfully destroyed"
end
end