# Simple controller test

**URL:** <https://discuss.emberjs.com/t/simple-controller-test/5933>\
**Category:** Testing\
**Created:** [July 19, 2014, 11:33pm UTC](https://discuss.emberjs.com/t/simple-controller-test/5933 "2014-07-19T23:33:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![saad0914](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@saad0914](https://discuss.emberjs.com/u/saad0914)\
**Post date:** [July 19, 2014, 11:33pm UTC](https://discuss.emberjs.com/t/simple-controller-test/5933/1 "2014-07-19T23:33:30Z")

</div>

Alright, so I am trying to follow along with the ember online documentation and doing something I think is very simple:

```
                // grab an instance of 'ApplicationController'
                var ctrl = window.App.ApplicationController.create();
                // wrap the test in the run loop because we are dealing with async functions
                Ember.run(function () {
                    // set a generic model on the post controller
                    ctrl.set('model', sampleJsonObject);

                    var canEdit = ctrl.get('canEdit');

                    console.log(canEdit);

                });

```

Unfortunately the second call to variable ctrl which is a get fails: error ==\> TypeError: Object doesn’t support property or method ‘get’

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![swatijadhav](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/swatijadhav/32/15964_2.png) [@swatijadhav](https://discuss.emberjs.com/u/swatijadhav)\
**Post date:** [August 4, 2014, 9:50am UTC](https://discuss.emberjs.com/t/simple-controller-test/5933/2 "2014-08-04T09:50:53Z")

</div>

> [@saad0914](#):
>
> // grab an instance of ‘ApplicationController’ var ctrl = window.App.ApplicationController.create();

Here it should be as follows:

```
// grab an instance of 'ApplicationController'
var ctrl = this.subject();

```

This would solve your issue.

Thanks.
