be($this->user()); $this->call('GET', '/rules/groups/create'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\RuleGroupController::delete */ public function testDelete() { $this->be($this->user()); $this->call('GET', '/rules/groups/delete/1'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\RuleGroupController::destroy */ public function testDestroy() { $this->session(['rules.rule-group.delete.url' => 'http://localhost']); $this->be($this->user()); $this->call('POST', '/rules/groups/destroy/1'); $this->assertResponseStatus(302); $this->assertSessionHas('success'); } /** * @covers FireflyIII\Http\Controllers\RuleGroupController::down */ public function testDown() { $this->be($this->user()); $this->call('GET', '/rules/groups/down/1'); $this->assertResponseStatus(302); } /** * @covers FireflyIII\Http\Controllers\RuleGroupController::edit */ public function testEdit() { $this->be($this->user()); $this->call('GET', '/rules/groups/edit/1'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\RuleGroupController::store * @covers FireflyIII\Http\Requests\RuleGroupFormRequest::authorize * @covers FireflyIII\Http\Requests\RuleGroupFormRequest::rules */ public function testStore() { $this->session(['rules.rule-group.create.url' => 'http://localhost']); $args = [ 'title' => 'Some new rule group', 'description' => 'New rules', ]; $this->be($this->user()); $this->call('POST', '/rules/groups/store', $args); $this->assertResponseStatus(302); $this->assertSessionHas('success'); } /** * @covers FireflyIII\Http\Controllers\RuleGroupController::up */ public function testUp() { $this->be($this->user()); $this->call('GET', '/rules/groups/up/1'); $this->assertResponseStatus(302); } /** * @covers FireflyIII\Http\Controllers\RuleGroupController::update * @covers FireflyIII\Http\Requests\RuleGroupFormRequest::authorize * @covers FireflyIII\Http\Requests\RuleGroupFormRequest::rules */ public function testUpdate() { $this->session(['rules.rule-group.edit.url' => 'http://localhost']); $args = [ 'id' => 1, 'title' => 'Some new rule group X', 'description' => 'New rules', 'active' => 1, ]; $this->be($this->user()); $this->call('POST', '/rules/groups/update/1', $args); $this->assertResponseStatus(302); $this->assertSessionHas('success'); } }