# RSpec Testing Problem with Namespace

**URL:** <https://www.ruby-forum.com/t/rspec-testing-problem-with-namespace/119707>\
**Category:** Rails\
**Created:** [November 9, 2007, 1:24pm UTC](https://www.ruby-forum.com/t/rspec-testing-problem-with-namespace/119707 "2007-11-09T13:24:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raecoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3d9bf3/32.png) [@raecoo](https://www.ruby-forum.com/u/raecoo)\
**Post date:** [November 9, 2007, 1:24pm UTC](https://www.ruby-forum.com/t/rspec-testing-problem-with-namespace/119707/1 "2007-11-09T13:24:23Z")

</div>

hi all,

i use Rspec 1.0.8 and Rspec on Rails testing my project,but the  
Namespace  
error to happen.

my project have two controller,follow:

app/controllers/admin/forums\_controller.rb  
app/controllers/forums\_controller.rb

and two spec

spec/controllers/admin/forums\_controller\_spec.rb(A)  
spec/controllers/forums\_controller\_spec.rb(B)

## forum\_controller\_spec.rb(A)'s code:

require File.dirname( **FILE** ) + ‘/…/…/spec\_helper’  
describe Admin::ForumsController do  
it “should use Admin::ForumsController” do  
controller.should be\_an\_instance\_of(Admin::ForumsController)  
puts controller # ©  
end

## D

it “create new forum” do  
controller.should be\_an\_instance\_of(Admin::ForumsController)  
put ‘create’,{:forums =\> {:parent\_id=\>‘0’,:name=\>‘forum tests’}}  
response.should redirect\_to(:action =\> “index”)  
flash[:notice].should ==‘create ok.’  
end  
end

run rake spec:autotest command ,the ## D will load  
ForumController(B) , but must load ForumController(A),What happen?  
who can help me!

---

<div class="post-metadata">

**Author:** ![raecoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3d9bf3/32.png) [@raecoo](https://www.ruby-forum.com/u/raecoo)\
**Post date:** [November 11, 2007, 2:54pm UTC](https://www.ruby-forum.com/t/rspec-testing-problem-with-namespace/119707/2 "2007-11-11T14:54:38Z")

</div>

On Nov 9, 2007 11:21 PM, Raecoo C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> no body help me?

Try the rspec list:

[http://rubyforge.org/pipermail/rspec-users/](http://rubyforge.org/pipermail/rspec-users/)

---

<div class="post-metadata">

**Author:** ![raecoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3d9bf3/32.png) [@raecoo](https://www.ruby-forum.com/u/raecoo)\
**Post date:** [November 10, 2007, 6:21am UTC](https://www.ruby-forum.com/t/rspec-testing-problem-with-namespace/119707/3 "2007-11-10T06:21:50Z")

</div>

no body help me?

---

<div class="post-metadata">

**Author:** ![raecoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3d9bf3/32.png) [@raecoo](https://www.ruby-forum.com/u/raecoo)\
**Post date:** [November 11, 2007, 3:00pm UTC](https://www.ruby-forum.com/t/rspec-testing-problem-with-namespace/119707/4 "2007-11-11T15:00:56Z")

</div>

thank you

David C. wrote:

> On Nov 9, 2007 11:21 PM, Raecoo C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > no body help me?
> 
> Try the rspec list:
> 
> [http://rubyforge.org/pipermail/rspec-users/](http://rubyforge.org/pipermail/rspec-users/)
