# Developing Discourse Plugins - Part 6 - Add acceptance tests

**URL:** https://meta.discourse.org/t/developing-discourse-plugins-part-6-add-acceptance-tests/32619
**Category:** Developer Guides
**Tags:** testing, plugin-guides, tutorial
**Created:** [August 27, 2015, 9:32pm UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-6-add-acceptance-tests/32619 "2015-08-27T21:32:26Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [September 1, 2017, 3:13am UTC](https://meta.discourse.org/t/developing-discourse-plugins-part-6-add-acceptance-tests/32619/9 "2017-09-01T03:13:21Z")

</div>

A note after writing some basic acceptance tests for the [Elections Plugin](https://meta.discourse.org/t/elections-plugin/68521):

- If you use the default `loggedIn` option, you’re logged in as `eviltrout` with the properties in this [session fixture](https://github.com/discourse/discourse/blob/master/test/javascripts/fixtures/session-fixtures.js.es6)

- You can login as a custom user (necessary if you’ve added custom user properties) by defining your own session fixture and setting it as the current user using the `beforeEach` hook. See [here for an example](https://github.com/angusmcleod/discourse-elections/blob/master/test/javascripts/acceptance/elections-test.js.es6#L5).

@eviltrout is there a better way of using a custom user for acceptance tests?

---

_[View the full topic](https://meta.discourse.org/t/developing-discourse-plugins-part-6-add-acceptance-tests/32619)._
