2022-11-20 15:52:18 -05:00
|
|
|
require "application_system_test_case"
|
|
|
|
|
|
|
|
class MembersTest < ApplicationSystemTestCase
|
|
|
|
setup do
|
|
|
|
@member = members(:one)
|
2024-09-08 21:07:51 -04:00
|
|
|
login(users(:one).email)
|
2022-11-20 15:52:18 -05:00
|
|
|
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
|