# Testing subdomains as account keys

**URL:** <https://www.ruby-forum.com/t/testing-subdomains-as-account-keys/173564>\
**Category:** Rails\
**Created:** [August 11, 2009, 2:18pm UTC](https://www.ruby-forum.com/t/testing-subdomains-as-account-keys/173564 "2009-08-11T14:18:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![subv3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@subv3](https://www.ruby-forum.com/u/subv3)\
**Post date:** [August 11, 2009, 2:18pm UTC](https://www.ruby-forum.com/t/testing-subdomains-as-account-keys/173564/1 "2009-08-11T14:18:43Z")

</div>

Hello,

I’m just starting to write tests for my apps (I’ve really been putting  
it off). Im trying to test the following code but I’m getting an error  
“undefined local variable or method `current\_account’” in a functional  
test.

My codes is @ [application\_controller.rb · GitHub](https://gist.github.com/62b19d8e8d26e392a4b4)

Basically, how can I get access to the current\_account method in my  
functional test?

Thanks

---

<div class="post-metadata">

**Author:** ![subv3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@subv3](https://www.ruby-forum.com/u/subv3)\
**Post date:** [August 11, 2009, 3:58pm UTC](https://www.ruby-forum.com/t/testing-subdomains-as-account-keys/173564/2 "2009-08-11T15:58:50Z")

</div>

I think I’ve got it now. I’m now calling @controller.send  
(:current\_account) rather than current\_account. I’m using send because  
the method is private.
