indiamos / learnwitch

Bookmarking meets GTD?

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TEST: Write api tests for Novelty + Newt

indiamos opened this issue · comments

commented

As a developer, I want tests to make sure that the following operations work, so I can tell when I break something:

Create

  • Novelty records can be added to the database
  • Newt records can be added to the database
  • Novelty and Newt records can be associated with each other, through the table novelty_newt
  • a user cannot create Novelty groups having identical (case insensitive) names (but different users can each create a Novelty called, say, “Learn Python”)

Read

  • all Novelty groups having a particular Newt can be retrieved
  • all Newts belonging to a particular Novelty can be retrieved

Update

  • a Novelty can be revised
  • when a Newt is removed from a Novelty, the related novelty_newt row is also removed

Destroy

  • when a Novelty is deleted, all related novelty_newt rows are also deleted