Basic feature implemented, very basic poc
This commit is contained in:
parent
216089a3e7
commit
48c0067076
118 changed files with 2113 additions and 20 deletions
48
test/controllers/checks_controller_test.rb
Normal file
48
test/controllers/checks_controller_test.rb
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
require "test_helper"
|
||||
|
||||
class ChecksControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@check = checks(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get checks_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get new_check_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create check" do
|
||||
assert_difference("Check.count") do
|
||||
post checks_url, params: { check: { level: @check.level, name: @check.name, position: @check.position, success_criterion: @check.success_criterion } }
|
||||
end
|
||||
|
||||
assert_redirected_to check_url(Check.last)
|
||||
end
|
||||
|
||||
test "should show check" do
|
||||
get check_url(@check)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get edit_check_url(@check)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update check" do
|
||||
patch check_url(@check), params: { check: { level: @check.level, name: @check.name, position: @check.position, success_criterion: @check.success_criterion } }
|
||||
assert_redirected_to check_url(@check)
|
||||
end
|
||||
|
||||
test "should destroy check" do
|
||||
assert_difference("Check.count", -1) do
|
||||
delete check_url(@check)
|
||||
end
|
||||
|
||||
assert_redirected_to checks_url
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue