Rullst AcademyRullst Academy/Lesson
Applications with Rullst I · Lesson 12 / 14

Tests that investigate the contract

Seeing a page open is only the start of verification.

Learning paths20 min

Let's discover together

  1. 1

    src/validation.rs tests a function without network or database. tests/contract.rs uses Rullst TestApp to send requests through the router and check status and data. The persistence test closes connections and opens new files. Each type answers different questions.

  2. 2

    Run cargo test --locked. Read names, not only the green total. Rejection evidence needs the correct status and an unchanged database. Parameterized-text evidence includes unusual input and a still-working table. Avoid tests that merely repeat an implementation constant.

  3. 3

    Choose a plausible bug: replace WHERE id with an unfiltered UPDATE in a disposable copy. A two-mission test should detect that the other must not change. Then revert the bug and keep the test. Do not run this experiment on someone’s database.

  4. 4

    The final project asks for a new case you write and an explanation of what it does not cover. TestApp does not test a real browser, clean installation, load or screen readers. Useful review combines suitable tests with observation and another person’s feedback.

Your application workbench

The kit includes a complete app to investigate and modify. The excerpt below explains this step; the editor contains the indicated file. Rullst Academy does not compile or run this server in your browser.

File to study and modify

tests/contract.rs

cargo test --locked
cargo test --locked title_and_priority_boundaries
cargo test --locked http_contract_validation_and_parameterized_data

Extract the kit to a new folder and open a terminal beside Cargo.toml. Use Rust 1.96+; the first build may download dependencies and take time. Then open http://127.0.0.1:3010. Stop with Ctrl+C and run again after editing.

cargo test --locked
cargo run --locked
My files and GitHub

Download your draft and replace the indicated file in your extracted copy. The editor saves one file in this browser; your account saves assessments and XP. The ZIP excludes your edits. GitHub sends only the confirmed file; use Git manually for the whole app, excluding databases, backups and secrets.

Official links and next step

✦
YOUR MISSION

Distinguish function, HTTP and recovery tests; add a useful regression.

Now it's your turn

Discovery workshop

Decide before running

Distinguish function, HTTP and recovery tests; add a useful regression.
Build your answers and check when you are ready.
A moment to understand

What does a passing test set allow you to claim?

I need a hint

Evidence has limits. A new case and independent feedback can reveal what previous tests missed.

Loading your journey…

Take it with you

Add a test that completes one mission and verifies another stays pending. Make it fail with a deliberate bug in a copy, fix it and record before/after.

At your own pace

My files and GitHub

Every lesson can become your own record: code, notes or a practice plan. Saving a file to GitHub is optional and does not change your XP.

Student guide

The editor and downloads open when this lesson is available to your account. Check access below or return to the track map.

Checking your access to this lesson…

Rullstpetbot

AI can make mistakes. Check the lesson material.