budget/test/controllers/members_controller_test.rb
Andrew Tomaka fd75a7c6ff
All checks were successful
continuous-integration/drone/push Build is passing
Update and connect to drone (#1)
Reviewed-on: #1
2023-03-08 19:25:24 -05:00

48 lines
1 KiB
Ruby

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
post members_url, params: {member: {name: @member.name, pays: @member.pays}}
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
patch member_url(@member), params: {member: {name: @member.name, pays: @member.pays}}
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