public function testPutVoteRemove() { $this->beatmapDiscussion->vote(['score' => 1, 'user_id' => $this->user->user_id]); $currentVotes = BeatmapDiscussionVote::count(); $currentScore = $this->currentScore($this->beatmapDiscussion); $this->actingAs($this->user)->put(route('beatmap-discussions.vote', $this->beatmapDiscussion), ['beatmap_discussion_vote' => ['score' => '0']])->assertResponseOk(); $this->assertEquals($currentVotes - 1, BeatmapDiscussionVote::count()); $this->assertEquals($currentScore - 1, $this->currentScore($this->beatmapDiscussion)); }