# RSpec

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

[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:** 93

---

## [Spec Server on Windows - missing fork](https://www.ruby-forum.com/t/spec-server-on-windows-missing-fork/144821)

<div class="topic-metadata">

**Author:** [@chicagogrooves](https://www.ruby-forum.com/u/chicagogrooves)\
**Replies:** 9\
**Last updated:** [August 6, 2008, 10:07am UTC](https://www.ruby-forum.com/t/spec-server-on-windows-missing-fork/144821 "2008-08-06T10:07:39Z")

</div>

Really tired of 30 second startup times to run Test::Unit tests, I would give my left pinky for a solution to running spec\_server on windows. Is there some monkey patch that can avoid daemonizing the process altogethe…

---

## [Autotest Doesn't Run Old Test::Unit Tests After Install](https://www.ruby-forum.com/t/autotest-doesnt-run-old-test-unit-tests-after-install/145073)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 2\
**Last updated:** [August 6, 2008, 9:26am UTC](https://www.ruby-forum.com/t/autotest-doesnt-run-old-test-unit-tests-after-install/145073 "2008-08-06T09:26:28Z")

</div>

Hi, We have a biggish rails app with a bunch of ‘legacy’ Test::Unit tests, but we’re moving over to rspec for all our new work. We’re going to be carrying these legacy tests around for a good while though, so they ne…

---

## [Writing specs for a plugin module for ActionController](https://www.ruby-forum.com/t/writing-specs-for-a-plugin-module-for-actioncontroller/144655)

<div class="topic-metadata">

**Author:** [@Leslie\_F](https://www.ruby-forum.com/u/Leslie_F)\
**Replies:** 1\
**Last updated:** [August 6, 2008, 5:42am UTC](https://www.ruby-forum.com/t/writing-specs-for-a-plugin-module-for-actioncontroller/144655 "2008-08-06T05:42:03Z")

</div>

Hello, I’m trying to spec a plugin that includes a module that adds functionality to ActionController below is what I’ve come up with: vendor/plugins/custom\_attribute\_fu/spec/active\_record\_spec.rb require File.dirname…

---

## [HTML Story Formatter](https://www.ruby-forum.com/t/html-story-formatter/143994)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 12\
**Last updated:** [August 6, 2008, 5:27am UTC](https://www.ruby-forum.com/t/html-story-formatter/143994 "2008-08-06T05:27:25Z")

</div>

Hiya, I am trying to use the HTML Story Formatter in conjunction with CruiseControl.rb. I have got it outputting the stories to a file, but I notice there are CSS and JS files linked in the head, which don’t appear t…

---

## [Rails controller specs and private helper methods](https://www.ruby-forum.com/t/rails-controller-specs-and-private-helper-methods/145041)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 1\
**Last updated:** [August 5, 2008, 8:33pm UTC](https://www.ruby-forum.com/t/rails-controller-specs-and-private-helper-methods/145041 "2008-08-05T20:33:59Z")

</div>

Hello guys, Been a while since last time I worked with Rails so is taking me a while get back to full speed. For a specific scenario I’m facing right now, I required to implement a generic REST controller that accept…

---

## [Autotest quits when code has errors](https://www.ruby-forum.com/t/autotest-quits-when-code-has-errors/144360)

<div class="topic-metadata">

**Author:** [@idahoev](https://www.ruby-forum.com/u/idahoev)\
**Replies:** 7\
**Last updated:** [August 5, 2008, 7:42pm UTC](https://www.ruby-forum.com/t/autotest-quits-when-code-has-errors/144360 "2008-08-05T19:42:36Z")

</div>

Sorry, I’d put this in a ZenTest forum (as opposed to RSpec), except that I can’t find one. I find it frustrating that autotest keeps running when it finds failing tests - but it quits back to the command line wheneve…

---

## [It\_should\_behave\_like and arguments](https://www.ruby-forum.com/t/it-should-behave-like-and-arguments/144846)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 2\
**Last updated:** [August 5, 2008, 10:28am UTC](https://www.ruby-forum.com/t/it-should-behave-like-and-arguments/144846 "2008-08-05T10:28:29Z")

</div>

Hello list, I’m trying to setup some shared specs to describe a CRUD controller and want to reuse the logic in it. I’m basing most of the examples in latest David’s post about it \[1\] The thing is that looking at the …

---

## [Capistrano: after\_deploy system specs?](https://www.ruby-forum.com/t/capistrano-after-deploy-system-specs/144262)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 1\
**Last updated:** [August 5, 2008, 2:29am UTC](https://www.ruby-forum.com/t/capistrano-after-deploy-system-specs/144262 "2008-08-05T02:29:26Z")

</div>

Hi everyone, I was curious if anyone out there had any examples or advice for running specs on system status. I would like to analyze unix utilities such as ps -aux|grep dispatch, uptime, top (ruby processes), proper…

---

## [Can't access actions of a singular nested resource](https://www.ruby-forum.com/t/cant-access-actions-of-a-singular-nested-resource/144620)

<div class="topic-metadata">

**Author:** [@bastien-vaucher](https://www.ruby-forum.com/u/bastien-vaucher)\
**Replies:** 8\
**Last updated:** [August 4, 2008, 4:14pm UTC](https://www.ruby-forum.com/t/cant-access-actions-of-a-singular-nested-resource/144620 "2008-08-04T16:14:41Z")

</div>

I can’t figure out what I do wrong there, I have a nested controller which is defined as a singular resource, the routing works properly, but inside my specs the request never goes through the show action. I keep on g…

---

## [Rspec doesn't pickup the status code correctly](https://www.ruby-forum.com/t/rspec-doesnt-pickup-the-status-code-correctly/144880)

<div class="topic-metadata">

**Author:** [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Replies:** 6\
**Last updated:** [August 4, 2008, 6:22am UTC](https://www.ruby-forum.com/t/rspec-doesnt-pickup-the-status-code-correctly/144880 "2008-08-04T06:22:02Z")

</div>

I’m setting the status code on a controller action but rspec doesn’t seem to be catching it in my spec. It works in the browser. This is the controller method, called via xhr with header Accept: ‘application/json’ de…

---

## [Spec'ing correct use of Timeout](https://www.ruby-forum.com/t/specing-correct-use-of-timeout/144810)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 1\
**Last updated:** [August 2, 2008, 4:47pm UTC](https://www.ruby-forum.com/t/specing-correct-use-of-timeout/144810 "2008-08-02T16:47:00Z")

</div>

Heya all, I have an interesting case that I would like to bounce off the list. I have a separate thread going in ruby-talk about Timeout.timeout still running after the timeout specified. The spec on this has been t…

---

## [Cheat install\_rspec\_rails -x](https://www.ruby-forum.com/t/cheat-install-rspec-rails-x/144766)

<div class="topic-metadata">

**Author:** [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 9:27pm UTC](https://www.ruby-forum.com/t/cheat-install-rspec-rails-x/144766 "2008-08-01T21:27:07Z")

</div>

Should this be valuable for anyone else, I’ve forked cheat (hoping for it to get pulled) to allow cheat to be used for execution. For example: cheat install\_rspec\_rails --execute OR cheat install\_rspec\_rails --x ht…

---

## [Rails views have\_tag with html inside](https://www.ruby-forum.com/t/rails-views-have-tag-with-html-inside/144765)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 0\
**Last updated:** [August 1, 2008, 9:23pm UTC](https://www.ruby-forum.com/t/rails-views-have-tag-with-html-inside/144765 "2008-08-01T21:23:36Z")

</div>

Is there a way to use “have\_tag” to match tags with HTML content? I want this: response.should have\_tag(‘span#customer\_address’, ‘123 Main St. Anytown, FL 32803’) and that is what renders in the view, but it won’t ma…

---

## [Clear a stub](https://www.ruby-forum.com/t/clear-a-stub/144253)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 8\
**Last updated:** [July 30, 2008, 2:47am UTC](https://www.ruby-forum.com/t/clear-a-stub/144253 "2008-07-30T02:47:40Z")

</div>

I can’t find it on the RSpec site, and my googling is turning up nothing. Is there a way to clear a stub once set? I’m experiencing some behavior where I have some nested describes, with “before :each” and I need to c…

---

## [$LOAD\_PATH problem when creating rake task](https://www.ruby-forum.com/t/load-path-problem-when-creating-rake-task/144398)

<div class="topic-metadata">

**Author:** [@Tero\_T](https://www.ruby-forum.com/u/Tero_T)\
**Replies:** 4\
**Last updated:** [July 29, 2008, 12:58pm UTC](https://www.ruby-forum.com/t/load-path-problem-when-creating-rake-task/144398 "2008-07-29T12:58:40Z")

</div>

I’m trying to put together some rake tasks to run my specs, but require ‘spec/rake/spectask’ complains “no such file”. I’ve gem installed rspec on my Ubuntu box and looks like it’s locate in /var/lib/gems/1.8/gems/rs…

---

## [Newbie question, populate or ignore test db](https://www.ruby-forum.com/t/newbie-question-populate-or-ignore-test-db/143615)

<div class="topic-metadata">

**Author:** [@Teedub](https://www.ruby-forum.com/u/Teedub)\
**Replies:** 5\
**Last updated:** [July 27, 2008, 6:45am UTC](https://www.ruby-forum.com/t/newbie-question-populate-or-ignore-test-db/143615 "2008-07-27T06:45:41Z")

</div>

Hi, I have been attempting to get rspec running on Ubuntu without much luck. I finally got it to go, but I can’t figure out how to turn off the database access. I created a new test project named myspec Ran script…

---

## [Problems with mock assigned to a constant](https://www.ruby-forum.com/t/problems-with-mock-assigned-to-a-constant/144074)

<div class="topic-metadata">

**Author:** [@mly](https://www.ruby-forum.com/u/mly)\
**Replies:** 21\
**Last updated:** [July 25, 2008, 8:44pm UTC](https://www.ruby-forum.com/t/problems-with-mock-assigned-to-a-constant/144074 "2008-07-25T20:44:02Z")

</div>

Hi all, Initially I thought this was a bug in the built-in mocking framework(and it still may be), but I better hash it out on the mailing list before I file/reopen the ticket: http://rspec.lighthouseapp.com/project…

---

## [Webrat visits fails, but works in browser](https://www.ruby-forum.com/t/webrat-visits-fails-but-works-in-browser/144096)

<div class="topic-metadata">

**Author:** [@fxp](https://www.ruby-forum.com/u/fxp)\
**Replies:** 2\
**Last updated:** [July 25, 2008, 4:54pm UTC](https://www.ruby-forum.com/t/webrat-visits-fails-but-works-in-browser/144096 "2008-07-25T16:54:46Z")

</div>

I’m wondering if folks have suggestions for how I can debug the following problem. I have some RSpec Stories that use WebRat, and do a “visits hotels\_path” type of thing. It is failing, yet the page works fine in t…

---

## [Failing on rake but not on textmate (rails)](https://www.ruby-forum.com/t/failing-on-rake-but-not-on-textmate-rails/143708)

<div class="topic-metadata">

**Author:** [@macario](https://www.ruby-forum.com/u/macario)\
**Replies:** 9\
**Last updated:** [July 24, 2008, 10:34pm UTC](https://www.ruby-forum.com/t/failing-on-rake-but-not-on-textmate-rails/143708 "2008-07-24T22:34:35Z")

</div>

I have a spec for a model that passes all tests if I run it using textmate but I run rake some of the otherwise passed tests fail. I would like to use autotest but I can’t trust the results. Any ideas?

---

## [Speccing a respond\_to block outside of a request](https://www.ruby-forum.com/t/speccing-a-respond-to-block-outside-of-a-request/144000)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 0\
**Last updated:** [July 24, 2008, 3:35pm UTC](https://www.ruby-forum.com/t/speccing-a-respond-to-block-outside-of-a-request/144000 "2008-07-24T15:35:15Z")

</div>

Hi – I have a bunch of controllers whose index actions are so similar, I can safely stick most of the code in a superclass. I am having trouble, however, in speccing the index method in the superclass. It could look …

---

## [Running all stories in a directory](https://www.ruby-forum.com/t/running-all-stories-in-a-directory/143989)

<div class="topic-metadata">

**Author:** [@wolfmanjm](https://www.ruby-forum.com/u/wolfmanjm)\
**Replies:** 1\
**Last updated:** [July 24, 2008, 1:24pm UTC](https://www.ruby-forum.com/t/running-all-stories-in-a-directory/143989 "2008-07-24T13:24:53Z")

</div>

I have a bunch on non-rails stories, and I want to run them all with either a rake task or a script. I tried the all.rb approach from rails, but is doesn’t seem to work. I do this basically… dir = File.dirname(FILE) …

---

## [Routes not working properly inside "helper"](https://www.ruby-forum.com/t/routes-not-working-properly-inside-helper/143902)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 1\
**Last updated:** [July 23, 2008, 6:30pm UTC](https://www.ruby-forum.com/t/routes-not-working-properly-inside-helper/143902 "2008-07-23T18:30:53Z")

</div>

I have been upgrading my helper specs due to the recent change regarding mixing in modules: http://blog.davidchelimsky.net/2008/5/29/rspec-waving-bye-bye-to-implicit-module-inclusion Unfortunately I have hit a snag. I…

---

## [Specing a rails monkey patch](https://www.ruby-forum.com/t/specing-a-rails-monkey-patch/143427)

<div class="topic-metadata">

**Author:** [@Keith\_McDonnell](https://www.ruby-forum.com/u/Keith_McDonnell)\
**Replies:** 4\
**Last updated:** [July 23, 2008, 9:19am UTC](https://www.ruby-forum.com/t/specing-a-rails-monkey-patch/143427 "2008-07-23T09:19:49Z")

</div>

Hi all, I wrote an ActiveRecord extension to emulate a db cursor: http://pastie.org/236367 As you can see, the spec doesn’t really ensure that the records are fetched in chunks. I’d like to mock the call to AR find a…

---

## [Rspec - stubbing same class multiple times with different co](https://www.ruby-forum.com/t/rspec-stubbing-same-class-multiple-times-with-different-co/143831)

<div class="topic-metadata">

**Author:** [@tafkamk](https://www.ruby-forum.com/u/tafkamk)\
**Replies:** 3\
**Last updated:** [July 23, 2008, 7:23am UTC](https://www.ruby-forum.com/t/rspec-stubbing-same-class-multiple-times-with-different-co/143831 "2008-07-23T07:23:10Z")

</div>

Im having a hard time with a rspec controller test im writting, I need to stub! the User.find call twice once to return the owning user and once to return the viewing user. however when I attempt User.stub!(:find).wit…

---

## [\[HELP\] should receive :new but does not](https://www.ruby-forum.com/t/help-should-receive-new-but-does-not/143826)

<div class="topic-metadata">

**Author:** [@Camilo\_T](https://www.ruby-forum.com/u/Camilo_T)\
**Replies:** 2\
**Last updated:** [July 23, 2008, 4:08am UTC](https://www.ruby-forum.com/t/help-should-receive-new-but-does-not/143826 "2008-07-23T04:08:20Z")

</div>

Hello, I am learning rspec/rspec-rails and ruby on rails. Controller: class IssuesController \< ApplicationController def index end def new @issue = Issue.new end def create @issue = Issue.new(params\[:issue\]) @i…

---

## [Funny single line of rspec\_code](https://www.ruby-forum.com/t/funny-single-line-of-rspec-code/143782)

<div class="topic-metadata">

**Author:** [@Britt\_Mileshosky](https://www.ruby-forum.com/u/Britt_Mileshosky)\
**Replies:** 1\
**Last updated:** [July 22, 2008, 6:43pm UTC](https://www.ruby-forum.com/t/funny-single-line-of-rspec-code/143782 "2008-07-22T18:43:05Z")

</div>

So lastnight I was writing a fake controller to test some before filter action. I found myself writing this line of code that I thought was funny … maybe its a subtle indication i’ve been programming to much lately. …

---

## [Specifying a few valid values](https://www.ruby-forum.com/t/specifying-a-few-valid-values/143330)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 9\
**Last updated:** [July 21, 2008, 5:46pm UTC](https://www.ruby-forum.com/t/specifying-a-few-valid-values/143330 "2008-07-21T17:46:08Z")

</div>

I have a Rails spec where I want to check that the action\_name is either “create” or “update”. I can think of a couple of ways to do it, but none of them reads fantastically well: \[“create”, “update”\].should include(…

---

## [Errors in controller test](https://www.ruby-forum.com/t/errors-in-controller-test/143561)

<div class="topic-metadata">

**Author:** [@cheef](https://www.ruby-forum.com/u/cheef)\
**Replies:** 1\
**Last updated:** [July 20, 2008, 3:54pm UTC](https://www.ruby-forum.com/t/errors-in-controller-test/143561 "2008-07-20T15:54:22Z")

</div>

I catch very strange error while testing: NoMethodError in ‘VotingsController handling POST /votings should redirect to index if success’ You have a nil object when you didn’t expect it! You might have expected an i…

---

## ['$' placeholder naming can confuse your runner](https://www.ruby-forum.com/t/placeholder-naming-can-confuse-your-runner/143236)

<div class="topic-metadata">

**Author:** [@paolodona](https://www.ruby-forum.com/u/paolodona)\
**Replies:** 5\
**Last updated:** [July 20, 2008, 2:48pm UTC](https://www.ruby-forum.com/t/placeholder-naming-can-confuse-your-runner/143236 "2008-07-20T14:48:28Z")

</div>

Hi guys, I’m facing a strange behavior that smells like a bug. consider this scenario: Scenario: I’m cool Given that I am cool 4 times out of 7 and this step: Given(“that I am cool $n times out of $n\_total”) do |n, …

---

## [We ain't got no RSpec](https://www.ruby-forum.com/t/we-aint-got-no-rspec/143342)

<div class="topic-metadata">

**Author:** [@patched](https://www.ruby-forum.com/u/patched)\
**Replies:** 2\
**Last updated:** [July 18, 2008, 5:20pm UTC](https://www.ruby-forum.com/t/we-aint-got-no-rspec/143342 "2008-07-18T17:20:35Z")

</div>

Hey Guys, This last week on the Rails Envy Podcast we received an “interesting” voicemail. Jason encouraged me to make a remix, and I think you guys will appreciate what resulted. If you have a few minutes and need …

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

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