This project needs some tests.

Attached is a good start, but it definitely needs work. For example, five tests fail and I can't figure out why. Basically, the "Friends" tab isn't appearing on the users' pages. This means that any test that looks to 'user/%user/friends/*' fails.

Comments

sirkitree’s picture

Agreed. I was thinking about this last night due to some of the basic things still being broken. Thank you for getting a start on these!

shawn dearmond’s picture

Aha, my tests are failing because I didn't tell it to enable Views.

I'm going to break it into two tests. One that tests Views, and one that does not.

shawn dearmond’s picture

Status: Needs work » Needs review
StatusFileSize
new11.92 KB

Fully rewritten test file.

This one includes two tests: testAddAndRemoveFriends() and testDefaultViews().

There's also a public function called addFriendsAndRequests() which can be used to populate friendings and requests between three users. Both testAddAndRemoveFriends() and testDefaultViews() call this function.

shawn dearmond’s picture

StatusFileSize
new10.44 KB

Better test file. I streamlined it by removing a bunch of duplicate tests. Now it doesn't take so long to run.

sirkitree’s picture

Status: Needs review » Fixed

Great! I think these should be pretty sufficient for now.

Once #1105682: "Deny" link should be on user page next to "Approve". is in we should extend the user cases to test for the Deny link as well. I'll put a not in that ticket about it though. Committing.

http://drupalcode.org/project/flag_friend.git/commitdiff/a86fcf23cd0b495...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.