require 'test_helper' module Jobs class JobsControllerTest < ActionController::TestCase setup do @job = jobs_jobs(:one) end test "should get index" do get :index assert_response :success assert_not_nil assigns(:jobs) end test "should get new" do get :new assert_response :success end test "should create job" do assert_difference('Job.count') do post :create, job: { description: @job.description, how_to: @job.how_to, when_to: @job.when_to, where_to: @job.where_to, who_to: @job.who_to } end assert_redirected_to job_path(assigns(:job)) end test "should show job" do get :show, id: @job assert_response :success end test "should get edit" do get :edit, id: @job assert_response :success end test "should update job" do patch :update, id: @job, job: { description: @job.description, how_to: @job.how_to, when_to: @job.when_to, where_to: @job.where_to, who_to: @job.who_to } assert_redirected_to job_path(assigns(:job)) end test "should destroy job" do assert_difference('Job.count', -1) do delete :destroy, id: @job end assert_redirected_to jobs_path end end end