Skip to content

Firefly III: a personal finances manager

Cover JSON controller.

James Cole3f65d5d76061
diff --git a/tests/functional/JsonControllerCest.php b/tests/functional/JsonControllerCest.php
new file mode 100644
index 0000000000..0f76e1fdd7
--- /dev/null
+++ b/tests/functional/JsonControllerCest.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: sander
+ * Date: 21/12/14
+ * Time: 18:05
+ */
+
+/**
+ * Class JsonControllerCest
+ */
+class JsonControllerCest
+{
+ /**
+ * @param FunctionalTester $I
+ */
+ public function _after(FunctionalTester $I)
+ {
+ }
+
+ /**
+ * @param FunctionalTester $I
+ */
+ public function _before(FunctionalTester $I)
+ {
+ $I->amLoggedAs(['email' => '[email protected]', 'password' => 'james']);
+ }
+
+ /**
+ * @param FunctionalTester $I
+ */
+ public function categories(FunctionalTester $I)
+ {
+ $I->wantTo('See a JSON list of categories.');
+ $I->amOnPage('/json/categories');
+ $I->canSeeResponseCodeIs(200);
+ }
+
+ /**
+ * @param FunctionalTester $I
+ */
+ public function expenseAccounts(FunctionalTester $I)
+ {
+ $I->wantTo('See a JSON list of expense accounts.');
+ $I->amOnPage('/json/expense-accounts');
+ $I->canSeeResponseCodeIs(200);
+ }
+
+ /**
+ * @param FunctionalTester $I
+ */
+ public function revenueAccounts(FunctionalTester $I)
+ {
+ $I->wantTo('See a JSON list of revenue accounts.');
+ $I->amOnPage('/json/revenue-accounts');
+ $I->canSeeResponseCodeIs(200);
+ }
+}
\ No newline at end of file