Kasugaijin's open-source Ruby on Rails production app that enables dog rescue organisation staff in Mexico to post dogs and receive applications for adoption from users in USA and Canada..
Initially, I tried writing the first test using an assert_changes assertion, but it kept failing due to the app status not changing. This was odd because I could see that the put request was reaching the update action, and passing the if statement's conditions (I verified it by adding raise "hello" under the if statement, and "hello" would be raised).
The reason it was failing has something to do with the way Minitest references the fixtures, or maybe it's just how fixtures work. It essentially seemed to be comparing the original fixture app's status not with the updated fixture app status, but with the same original app status. I tried a lot of things but just couldn't get it to work, so I settled for this other approach.
Add Tests for Unverified Staff?
I'm thinking you might also want tests to ensure that unverified staff cannot make these changes to an application?
More tests for Issue #49
First Test Struggles
Initially, I tried writing the first test using an
assert_changes
assertion, but it kept failing due to the app status not changing. This was odd because I could see that theput
request was reaching theupdate
action, and passing theif
statement's conditions (I verified it by addingraise "hello"
under theif
statement, and"hello"
would be raised).The reason it was failing has something to do with the way Minitest references the fixtures, or maybe it's just how fixtures work. It essentially seemed to be comparing the original fixture app's status not with the updated fixture app status, but with the same original app status. I tried a lot of things but just couldn't get it to work, so I settled for this other approach.
Add Tests for Unverified Staff?
I'm thinking you might also want tests to ensure that unverified staff cannot make these changes to an application?