/** @test */ public function it_returns_only_rejected_stories() { $this->createPost([$this->status_column => Status::REJECTED], 5); $posts = Post::rejected()->get(); $this->assertNotEmpty($posts); foreach ($posts as $post) { $this->assertEquals(Status::REJECTED, $post->{$this->status_column}); } }
/** @test */ public function it_returns_all_stories() { $this->createPost([], 5); $posts = (new Post())->newQueryWithoutScope(new ModerationScope())->withAnyStatus()->get(); $allStories = Post::all()->merge(Post::pending()->get())->merge(Post::rejected()->get()); $this->assertNotEmpty($posts); //with rejected will return more stories than only approved $this->assertCount(count($posts), $allStories); }