2022-11-20 15:52:18 -05:00
|
|
|
require "test_helper"
|
|
|
|
|
|
|
|
class MembersControllerTest < ActionDispatch::IntegrationTest
|
|
|
|
setup do
|
|
|
|
@member = members(:one)
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should get index" do
|
|
|
|
get members_url
|
|
|
|
assert_response :success
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should get new" do
|
|
|
|
get new_member_url
|
|
|
|
assert_response :success
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should create member" do
|
|
|
|
assert_difference("Member.count") do
|
2023-03-07 22:09:33 -05:00
|
|
|
post members_url, params: {member: {name: @member.name, pays: @member.pays}}
|
2022-11-20 15:52:18 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
assert_redirected_to member_url(Member.last)
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should show member" do
|
|
|
|
get member_url(@member)
|
|
|
|
assert_response :success
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should get edit" do
|
|
|
|
get edit_member_url(@member)
|
|
|
|
assert_response :success
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should update member" do
|
2023-03-07 22:09:33 -05:00
|
|
|
patch member_url(@member), params: {member: {name: @member.name, pays: @member.pays}}
|
2022-11-20 15:52:18 -05:00
|
|
|
assert_redirected_to member_url(@member)
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should destroy member" do
|
|
|
|
assert_difference("Member.count", -1) do
|
|
|
|
delete member_url(@member)
|
|
|
|
end
|
|
|
|
|
|
|
|
assert_redirected_to members_url
|
|
|
|
end
|
|
|
|
end
|