TEST: Acceptance test for quick access assignments (#51)

TEST: Acceptance test for quick access assignments (#51)

diff --git a/test/javascripts/acceptance/quick-access-assignments-test.js.es6 b/test/javascripts/acceptance/quick-access-assignments-test.js.es6
new file mode 100644
index 0000000..a9cbeb6
--- /dev/null
+++ b/test/javascripts/acceptance/quick-access-assignments-test.js.es6
@@ -0,0 +1,38 @@
+import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
+import { default as AssignedTopics } from "../fixtures/assigned-topics-fixtures";
+
+const USER_MENU = "#current-user.header-dropdown-toggle";
+const QUICK_ACCESS_ASSIGNMENTS_TAB = ".widget-link.assigned";
+
+acceptance("Quick access assignments panel", {
+  loggedIn: true,
+  settings: {
+    assign_enabled: true,
+    assigns_user_url_path: "/"
+  },
+  pretend(server, helper) {
+    const messagesPath = "/topics/messages-assigned/eviltrout.json";
+    const assigns = AssignedTopics[messagesPath];
+    server.get(messagesPath, () => helper.response(assigns));
+  }
+});
+
+QUnit.test("Quick access assignments panel", async assert => {
+  updateCurrentUser({ can_assign: true });
+
+  await visit("/");
+  await click(USER_MENU);
+
+  await click(QUICK_ACCESS_ASSIGNMENTS_TAB);
+  const assignment = find(".quick-access-panel li a")[0];
+
+  assert.ok(assignment.innerText.includes("Greetings!"));
+  assert.ok(assignment.href.includes("/t/greetings/10/5"));
+
+  await click(QUICK_ACCESS_ASSIGNMENTS_TAB);
+  assert.equal(
+    currentPath(),
+    "user.userActivity.assigned",
+    "a second click should redirect to the full assignments page"
+  );
+});

GitHub sha: 653a529d