# RSpec

**URL:** https://www.ruby-forum.com/c/testing/rspec/25.md?page=33

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 34

---

## [Loading problem with engine extending ActionController::Base](https://www.ruby-forum.com/t/loading-problem-with-engine-extending-actioncontroller-base/191061)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 4\
**Last updated:** [July 5, 2010, 7:44pm UTC](https://www.ruby-forum.com/t/loading-problem-with-engine-extending-actioncontroller-base/191061 "2010-07-05T19:44:00Z")

</div>

I’m working on an engine that extends ActionController::Base like this module MyEngine class Engine \< Rails::Engine config.after\_initialize do ActionController::Base.class\_eval do include MyEngine::ControllerExt…

---

## [Problem specing application layout, missing partial?](https://www.ruby-forum.com/t/problem-specing-application-layout-missing-partial/191104)

<div class="topic-metadata">

**Author:** [@pixel](https://www.ruby-forum.com/u/pixel)\
**Replies:** 3\
**Last updated:** [July 5, 2010, 7:43pm UTC](https://www.ruby-forum.com/t/problem-specing-application-layout-missing-partial/191104 "2010-07-05T19:43:59Z")

</div>

In an effort to teach myself BDD I’m trying it out. I’m trying to do a simple (should be straightforward) spec on my application.html.haml file first looking for a div tag with the class ‘nav’ it seems that rspec is…

---

## [Help with nested routes test in Rails 3](https://www.ruby-forum.com/t/help-with-nested-routes-test-in-rails-3/191038)

<div class="topic-metadata">

**Author:** [@Lalish-MenaghS\_Trev](https://www.ruby-forum.com/u/Lalish-MenaghS_Trev)\
**Replies:** 2\
**Last updated:** [July 5, 2010, 2:13pm UTC](https://www.ruby-forum.com/t/help-with-nested-routes-test-in-rails-3/191038 "2010-07-05T14:13:13Z")

</div>

Hi all, I must be doing something wrong here. Could someone point me in the right direction? I am trying to test my nested resources in Rails 3. The route: resources :students do resources :days end The test: it …

---

## [Spec'ing namespaced routes](https://www.ruby-forum.com/t/specing-namespaced-routes/191084)

<div class="topic-metadata">

**Author:** [@dizzyone](https://www.ruby-forum.com/u/dizzyone)\
**Replies:** 1\
**Last updated:** [July 5, 2010, 2:09pm UTC](https://www.ruby-forum.com/t/specing-namespaced-routes/191084 "2010-07-05T14:09:07Z")

</div>

What’s the appropriate way to test namespaced routes with rspec-2 & rails 3? I imagined that the following would work but it does not. describe Admin::UsersController do describe “routing” do it “recognizes and gene…

---

## [\[ANN\] database\_resetter 0.1.0](https://www.ruby-forum.com/t/ann-database-resetter-0-1-0/191080)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 0\
**Last updated:** [July 4, 2010, 9:03pm UTC](https://www.ruby-forum.com/t/ann-database-resetter-0-1-0/191080 "2010-07-04T21:03:04Z")

</div>

Hi all Apologies for cross-posting and spam in the same post. Hopefully you’ll let me off this once… I just released my first gem (woo!), database\_resetter\[1\]. It’s designed to completely rebuild your Rails/Merb et…

---

## [Rspec controller test strange error: undefined method \`call' for nil:NilClass](https://www.ruby-forum.com/t/rspec-controller-test-strange-error-undefined-method-call-for-nil-nilclass/191037)

<div class="topic-metadata">

**Author:** [@doug](https://www.ruby-forum.com/u/doug)\
**Replies:** 0\
**Last updated:** [July 3, 2010, 8:24am UTC](https://www.ruby-forum.com/t/rspec-controller-test-strange-error-undefined-method-call-for-nil-nilclass/191037 "2010-07-03T08:24:47Z")

</div>

must be doing something dumb… not sure, but the ‘call’ appears to be on the block.call when the respond\_to block gets executed. straight forward “channels” resource with a ‘create’ action… only new thing is just assi…

---

## [Beginning writing RSpec with Rails model plugin](https://www.ruby-forum.com/t/beginning-writing-rspec-with-rails-model-plugin/191034)

<div class="topic-metadata">

**Author:** [@Jose\_Hales-Garcia](https://www.ruby-forum.com/u/Jose_Hales-Garcia)\
**Replies:** 0\
**Last updated:** [July 3, 2010, 3:01am UTC](https://www.ruby-forum.com/t/beginning-writing-rspec-with-rails-model-plugin/191034 "2010-07-03T03:01:09Z")

</div>

I want to write a Rails model plugin using RSpec. I’m using Rails 3, Ruby 1.9 and RSpec 2. I’ve read the RSpec and Rails documentation but haven’t found any examples of using RSpec in a Rails 3 plugin situation. Is …

---

## [Rspec2 / Rails3 / test\_unit](https://www.ruby-forum.com/t/rspec2-rails3-test-unit/191016)

<div class="topic-metadata">

**Author:** [@arco](https://www.ruby-forum.com/u/arco)\
**Replies:** 1\
**Last updated:** [July 2, 2010, 8:35pm UTC](https://www.ruby-forum.com/t/rspec2-rails3-test-unit/191016 "2010-07-02T20:35:23Z")

</div>

I generate a new rails3 app using “rails new my\_app -T”. Then i run “cd my\_app ; rails generate”, and I don’t see any test\_unit options. (as expected). Then I put “gem ‘rspec-rails’” into my Gemfile, and re-run “rails …

---

## [RSpec 2.0, Cucumber, ruby-debug](https://www.ruby-forum.com/t/rspec-2-0-cucumber-ruby-debug/190423)

<div class="topic-metadata">

**Author:** [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Replies:** 4\
**Last updated:** [July 2, 2010, 6:24pm UTC](https://www.ruby-forum.com/t/rspec-2-0-cucumber-ruby-debug/190423 "2010-07-02T18:24:47Z")

</div>

I see that I now need to pas -d or --debug with the rspec command line tool to use ruby-debug. What about with Cucumber? RSpec 2.0 Core overwrites Kernel#debugger that ruby-debug uses.

---

## [Cookie assignment and reading](https://www.ruby-forum.com/t/cookie-assignment-and-reading/190973)

<div class="topic-metadata">

**Author:** [@Josh\_Clayton](https://www.ruby-forum.com/u/Josh_Clayton)\
**Replies:** 2\
**Last updated:** [July 2, 2010, 6:23pm UTC](https://www.ruby-forum.com/t/cookie-assignment-and-reading/190973 "2010-07-02T18:23:01Z")

</div>

Hello all, I’m running the latest stable rspec/rspec-rails (1.3.0/1.3.2) in a Rails 2.3.8 app and am having trouble testing that a cookie gets deleted. In a semi-convoluted manner, I am essentially running code from …

---

## [Re: using rSpec stub in Cucumber with rSpec2](https://www.ruby-forum.com/t/re-using-rspec-stub-in-cucumber-with-rspec2/191000)

<div class="topic-metadata">

**Author:** [@Florent\_F.rent](https://www.ruby-forum.com/u/Florent_F.rent)\
**Replies:** 0\
**Last updated:** [July 2, 2010, 7:09am UTC](https://www.ruby-forum.com/t/re-using-rspec-stub-in-cucumber-with-rspec2/191000 "2010-07-02T07:09:15Z")

</div>

any other viable alternative? Alask has updated Cucumber so that we can now use RSpec 2 mockings frameworks: http://wiki.github.com/aslakhellesoy/cucumber/mocking-and-stubbing-with-cucumber

---

## [Shoulda and explicit subject](https://www.ruby-forum.com/t/shoulda-and-explicit-subject/190975)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 9\
**Last updated:** [July 2, 2010, 5:40am UTC](https://www.ruby-forum.com/t/shoulda-and-explicit-subject/190975 "2010-07-02T05:40:53Z")

</div>

I am trying to use Shoulda matchers with the latest beta version of RSpec for Rails 3. I’ve managed to track down the cause of my errors to needing to explicitly set the subject, but the Shoulda examples make no ment…

---

## [Rake spec options](https://www.ruby-forum.com/t/rake-spec-options/190963)

<div class="topic-metadata">

**Author:** [@Ibrahim\_A](https://www.ruby-forum.com/u/Ibrahim_A)\
**Replies:** 5\
**Last updated:** [July 2, 2010, 1:18am UTC](https://www.ruby-forum.com/t/rake-spec-options/190963 "2010-07-02T01:18:40Z")

</div>

Hi guys, Apologies if this is a dumb question. I’m new to rails and most of the information online is about rails 2 and rspec 1.3, but my group is using rails 3 and thus rspec 2. I’m trying to format the output of ra…

---

## [How to test index method of a controller?](https://www.ruby-forum.com/t/how-to-test-index-method-of-a-controller/190972)

<div class="topic-metadata">

**Author:** [@marcioa1](https://www.ruby-forum.com/u/marcioa1)\
**Replies:** 1\
**Last updated:** [July 1, 2010, 9:30pm UTC](https://www.ruby-forum.com/t/how-to-test-index-method-of-a-controller/190972 "2010-07-01T21:30:54Z")

</div>

Hi, My index methods def index @galleries = Gallery.filtered\_by(params.reverse\_merge!(:per\_page =\> 10)) end My spec: it "should list all galleries" do get :index response.should render\_template("index") end A…

---

## [Entering text into a text field using rspec](https://www.ruby-forum.com/t/entering-text-into-a-text-field-using-rspec/190974)

<div class="topic-metadata">

**Author:** [@tester86](https://www.ruby-forum.com/u/tester86)\
**Replies:** 2\
**Last updated:** [July 1, 2010, 9:28pm UTC](https://www.ruby-forum.com/t/entering-text-into-a-text-field-using-rspec/190974 "2010-07-01T21:28:33Z")

</div>

HI I am new to rspec. I am at a web page and in that page I want to enter in some text and then click send. it “will enter in some text ‘asf’” do end what command would I used to enter in the text as I have searched …

---

## [Rspec-rails 2 and spec/spec.opts or other configuration options for rake spec](https://www.ruby-forum.com/t/rspec-rails-2-and-spec-spec-opts-or-other-configuration-options-for-rake-spec/190976)

<div class="topic-metadata">

**Author:** [@Ibrahim\_A](https://www.ruby-forum.com/u/Ibrahim_A)\
**Replies:** 1\
**Last updated:** [July 1, 2010, 9:23pm UTC](https://www.ruby-forum.com/t/rspec-rails-2-and-spec-spec-opts-or-other-configuration-options-for-rake-spec/190976 "2010-07-01T21:23:51Z")

</div>

Hi guys, I apologize if this is a dumb question, but in rspec-rails version 2.0.0.14 (for rails 3.0.0b4) I’m trying to add configuration options like some tutorials mention in a file spec/spec.opts, but this has no e…

---

## [Using LINE with nested example groups](https://www.ruby-forum.com/t/using-line-with-nested-example-groups/190968)

<div class="topic-metadata">

**Author:** [@arco](https://www.ruby-forum.com/u/arco)\
**Replies:** 1\
**Last updated:** [July 1, 2010, 9:08pm UTC](https://www.ruby-forum.com/t/using-line-with-nested-example-groups/190968 "2010-07-01T21:08:03Z")

</div>

I would like to use the --line parameter with nested example groups (describe / context). It looks to me like rspec handles this fine if I select the innermost group. But if I select an outer group, rspec ignores all…

---

## [Using rSpec stub in Cucumber with rSpec2](https://www.ruby-forum.com/t/using-rspec-stub-in-cucumber-with-rspec2/190959)

<div class="topic-metadata">

**Author:** [@Florent\_F.rent](https://www.ruby-forum.com/u/Florent_F.rent)\
**Replies:** 0\
**Last updated:** [July 1, 2010, 5:27pm UTC](https://www.ruby-forum.com/t/using-rspec-stub-in-cucumber-with-rspec2/190959 "2010-07-01T17:27:54Z")

</div>

Hello, I have a Rails3beta4 project where I want to use rSpec stubs in a Cucumber feature. Unfortunately it looks like requiring ‘spec/stubs/cucumber’ in env.rb does not work anymore: I get a “no such file to load – …

---

## [Exception handling](https://www.ruby-forum.com/t/exception-handling/190910)

<div class="topic-metadata">

**Author:** [@rantamplan](https://www.ruby-forum.com/u/rantamplan)\
**Replies:** 7\
**Last updated:** [June 30, 2010, 5:54pm UTC](https://www.ruby-forum.com/t/exception-handling/190910 "2010-06-30T17:54:49Z")

</div>

Hello, I’m new in Rspec and I would like to ask a question. Suppose I have a test that fails raising an exception. I do not want the test to raise an exception and I’m not expecting one, but something fails and an e…

---

## [Using RSpec and Cucumber with Rails 3 Engines](https://www.ruby-forum.com/t/using-rspec-and-cucumber-with-rails-3-engines/190845)

<div class="topic-metadata">

**Author:** [@devbanana](https://www.ruby-forum.com/u/devbanana)\
**Replies:** 2\
**Last updated:** [June 29, 2010, 6:02pm UTC](https://www.ruby-forum.com/t/using-rspec-and-cucumber-with-rails-3-engines/190845 "2010-06-29T18:02:25Z")

</div>

Hi, I recently upgraded to Rails 3 beta, a few weeks ago. One thing I would really like to do is to develop components of my application, because some of them I’d really like to be able to reuse on other projects. I …

---

## [Undefined method](https://www.ruby-forum.com/t/undefined-method/190824)

<div class="topic-metadata">

**Author:** [@bertly\_the\_coder](https://www.ruby-forum.com/u/bertly_the_coder)\
**Replies:** 2\
**Last updated:** [June 29, 2010, 5:10am UTC](https://www.ruby-forum.com/t/undefined-method/190824 "2010-06-29T05:10:52Z")

</div>

Hey Guys, I am working on my first TDD/BDDD example and running into a problem, when I run 'ruby app.rb" The app seems to run fine, but when I run it’s rspec 'spec app\_spec.rb" I get a no method defined. app.rb requ…

---

## [Rspec](https://www.ruby-forum.com/t/rspec/190825)

<div class="topic-metadata">

**Author:** [@Curtis\_j\_Schofield](https://www.ruby-forum.com/u/Curtis_j_Schofield)\
**Replies:** 3\
**Last updated:** [June 28, 2010, 10:48pm UTC](https://www.ruby-forum.com/t/rspec/190825 "2010-06-28T22:48:03Z")

</div>

Hi - I extracted some methods in a refactor and put them into a nice module and i’m in the process of making sure it is covered as a first-class unit. I’m getting some strange behavior with what seems really straight …

---

## [Rake spec failure in beta.13](https://www.ruby-forum.com/t/rake-spec-failure-in-beta-13/190665)

<div class="topic-metadata">

**Author:** [@geetarista](https://www.ruby-forum.com/u/geetarista)\
**Replies:** 21\
**Last updated:** [June 28, 2010, 3:05pm UTC](https://www.ruby-forum.com/t/rake-spec-failure-in-beta-13/190665 "2010-06-28T15:05:24Z")

</div>

I just upgraded to beta.13 and I’m running into an issue where when I run ‘rake spec’, I get an ‘uninitialized constant Comment’ error. Comment is the first model (alphabetically) in my project. If I switch back to b…

---

## [ApplicationController helper methods in view specs?](https://www.ruby-forum.com/t/applicationcontroller-helper-methods-in-view-specs/190806)

<div class="topic-metadata">

**Author:** [@Alex\_Crichton](https://www.ruby-forum.com/u/Alex_Crichton)\
**Replies:** 1\
**Last updated:** [June 28, 2010, 3:00pm UTC](https://www.ruby-forum.com/t/applicationcontroller-helper-methods-in-view-specs/190806 "2010-06-28T15:00:07Z")

</div>

I’ve got some helper methods in my ApplicationController which the views use. In the view specs the methods are all undefined, however. Is this intended and is there some setting I need to use to get the methods inclu…

---

## [Autotest just returns](https://www.ruby-forum.com/t/autotest-just-returns/190785)

<div class="topic-metadata">

**Author:** [@Don\_F](https://www.ruby-forum.com/u/Don_F)\
**Replies:** 3\
**Last updated:** [June 28, 2010, 1:56pm UTC](https://www.ruby-forum.com/t/autotest-just-returns/190785 "2010-06-28T13:56:52Z")

</div>

I am trying to use rspec2 rails with rails3 beta 4. I created a simple project and a couple of models. The basic test spec files are there. When I run bundle spec:models I get what I expect. When I run bundle autotest…

---

## [Have\_tag matcher in rspec 2?](https://www.ruby-forum.com/t/have-tag-matcher-in-rspec-2/190787)

<div class="topic-metadata">

**Author:** [@woahdae](https://www.ruby-forum.com/u/woahdae)\
**Replies:** 1\
**Last updated:** [June 28, 2010, 5:43am UTC](https://www.ruby-forum.com/t/have-tag-matcher-in-rspec-2/190787 "2010-06-28T05:43:52Z")

</div>

I always assumed have\_tag was part of rspec, but it’s not in rspec 2, and looking now I don’t see it in rspec 1 either. Webrat defines it, but that seems like a coincidence (I tried requiring webrat/core/matchers to n…

---

## [\[rspec-rails-2\] conflict with view isolation and respond\_with](https://www.ruby-forum.com/t/rspec-rails-2-conflict-with-view-isolation-and-respond-with/190773)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [June 27, 2010, 3:09pm UTC](https://www.ruby-forum.com/t/rspec-rails-2-conflict-with-view-isolation-and-respond-with/190773 "2010-06-27T15:09:17Z")

</div>

Hey all, For those of you interested in view isolation in controller specs, an issue has been reported with ActionController’s new respond\_with method. Please take a look at errors when using respond\_with instead of r…

---

## [Rails 3 + latest rspec 2: route set not finalized](https://www.ruby-forum.com/t/rails-3-latest-rspec-2-route-set-not-finalized/190690)

<div class="topic-metadata">

**Author:** [@Timo\_RSSSSSSSSner](https://www.ruby-forum.com/u/Timo_RSSSSSSSSner)\
**Replies:** 2\
**Last updated:** [June 26, 2010, 6:56pm UTC](https://www.ruby-forum.com/t/rails-3-latest-rspec-2-route-set-not-finalized/190690 "2010-06-26T18:56:35Z")

</div>

Hey guys, i have a problem with latest rails 3 and rspec2.0.0.12beta. When running most of my (with rails 2 and rspec 1 working) controller specs i get: route set not finalized I reduced the problem to the max: $ c…

---

## [Testing only for a redirect](https://www.ruby-forum.com/t/testing-only-for-a-redirect/190721)

<div class="topic-metadata">

**Author:** [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Replies:** 5\
**Last updated:** [June 26, 2010, 1:17am UTC](https://www.ruby-forum.com/t/testing-only-for-a-redirect/190721 "2010-06-26T01:17:09Z")

</div>

Hello guys, Quick question: How could I just test if a redirect was made, without URL whatsoever? Thanks, Marcelo.

---

## [Quickie blog article about dealing with Bundler, RSpec and Rake](https://www.ruby-forum.com/t/quickie-blog-article-about-dealing-with-bundler-rspec-and-rake/190718)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 0\
**Last updated:** [June 25, 2010, 6:38pm UTC](https://www.ruby-forum.com/t/quickie-blog-article-about-dealing-with-bundler-rspec-and-rake/190718 "2010-06-25T18:38:25Z")

</div>

http://talklikeaduck.denhaven2.com/2010/06/25/making-rspec-rake-and-bundler-play-well-together Note this is for Rails 2.3, not sure if Rails 3 and Rspec 2 would be different. – Rick DeNatale Blog: http://talklikeadu…

[Previous page](https://www.ruby-forum.com/c/testing/rspec/25.md?page=32)

[Next page](https://www.ruby-forum.com/c/testing/rspec/25.md?page=34)
