volunteers/test/system/members_test.rb

44 lines
970 B
Ruby
Raw Normal View History

2022-12-20 16:05:26 +01:00
require "application_system_test_case"
class MembersTest < ApplicationSystemTestCase
setup do
@member = members(:one)
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 "Public" if @member.public
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 "Public" if @member.public
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