akam_roadmap/test/controllers/projects_controller_test.rb
Tyrel Souza 5f3840dfde more
2024-07-05 01:10:21 +00:00

50 lines
1.8 KiB
Ruby
Executable File

require 'test_helper'
class ProjectsControllerTest < ActionController::TestCase
setup do
@project = projects(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:projects)
end
test "should get new" do
get :new
assert_response :success
end
test "should create project" do
assert_difference('Project.count') do
post :create, project: { design_completed: @project.design_completed, design_due: @project.design_due, devops_completed: @project.devops_completed, devops_due: @project.devops_due, qalaunch_completed: @project.qalaunch_completed, qalaunch_due: @project.qalaunch_due, requirements_completed: @project.requirements_completed, requirements_due: @project.requirements_due, status: @project.status, title: @project.title }
end
assert_redirected_to project_path(assigns(:project))
end
test "should show project" do
get :show, id: @project
assert_response :success
end
test "should get edit" do
get :edit, id: @project
assert_response :success
end
test "should update project" do
patch :update, id: @project, project: { design_completed: @project.design_completed, design_due: @project.design_due, devops_completed: @project.devops_completed, devops_due: @project.devops_due, qalaunch_completed: @project.qalaunch_completed, qalaunch_due: @project.qalaunch_due, requirements_completed: @project.requirements_completed, requirements_due: @project.requirements_due, status: @project.status, title: @project.title }
assert_redirected_to project_path(assigns(:project))
end
test "should destroy project" do
assert_difference('Project.count', -1) do
delete :destroy, id: @project
end
assert_redirected_to projects_path
end
end