help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
ruby-todo-list
/
test
/
controllers
RSK World
ruby-todo-list
Ruby Todo List - Task Management with User Authentication + Categories + Search + File Attachments + Email Notifications + Rails MVC + Modern Web Interface + API Integration + Educational Design
controllers
  • categories_controller_test.rb1.7 KB
  • tasks_controller_test.rb1.5 KB
tasks_controller_test.rb
test/controllers/tasks_controller_test.rb
Raw Download
Find: Go to:
# Ruby To-Do List Application - Tasks Controller Test
# Created by: Molla Samser (help@rskworld.in, +91 93305 39277)
# Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
# Year: 2026

require "test_helper"

class TasksControllerTest < ActionDispatch::IntegrationTest
  include Devise::Test::IntegrationHelpers

  setup do
    @user = users(:one)
    @task = tasks(:one)
    sign_in @user
  end

  test "should get index" do
    get tasks_url
    assert_response :success
  end

  test "should get new" do
    get new_task_url
    assert_response :success
  end

  test "should create task" do
    assert_difference("Task.count") do
      post tasks_url, params: { task: { title: "New Task", description: "Task description", priority: 2 } }
    end

    assert_redirected_to task_url(Task.last)
  end

  test "should show task" do
    get task_url(@task)
    assert_response :success
  end

  test "should get edit" do
    get edit_task_url(@task)
    assert_response :success
  end

  test "should update task" do
    patch task_url(@task), params: { task: { title: "Updated Task" } }
    assert_redirected_to task_url(@task)
  end

  test "should destroy task" do
    assert_difference("Task.count", -1) do
      delete task_url(@task)
    end

    assert_redirected_to tasks_url
  end

  test "should toggle complete" do
    patch toggle_complete_task_url(@task)
    assert_redirected_to tasks_url

    @task.reload
    assert @task.completed?
  end
end
65 lines•1.5 KB
ruby

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer