# RSpec

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

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

---

## [Undefined method: controller\_name](https://www.ruby-forum.com/t/undefined-method-controller-name/122902)

<div class="topic-metadata">

**Author:** [@Alvin\_S](https://www.ruby-forum.com/u/Alvin_S)\
**Replies:** 2\
**Last updated:** [December 12, 2007, 9:02pm UTC](https://www.ruby-forum.com/t/undefined-method-controller-name/122902 "2007-12-12T21:02:28Z")

</div>

With rspec 1.0.8 I have a spec in the directory: spec/units/controllers/application\_controller\_spec.rb require File.dirname(FILE) + ‘/…/…/spec\_helper’ class DummyController \< ApplicationController def index raise “P…

---

## [Undefined method: controller\_name](https://www.ruby-forum.com/t/undefined-method-controller-name/122885)

<div class="topic-metadata">

**Author:** [@Alvin\_S](https://www.ruby-forum.com/u/Alvin_S)\
**Replies:** 0\
**Last updated:** [December 12, 2007, 7:15pm UTC](https://www.ruby-forum.com/t/undefined-method-controller-name/122885 "2007-12-12T19:15:50Z")

</div>

David C. wrote: On Dec 12, 2007 9:50 AM, Alvin S. \<a.schur at nucleus.com http://rubyforge.org/mailman/listinfo/rspec-users\> wrote: / With rspec 1.0.8 I have a spec in the directory: /\> \>/ spec/units/controllers/app…

---

## [RSpec TMbundle](https://www.ruby-forum.com/t/rspec-tmbundle/122812)

<div class="topic-metadata">

**Author:** [@confundido](https://www.ruby-forum.com/u/confundido)\
**Replies:** 5\
**Last updated:** [December 12, 2007, 7:12pm UTC](https://www.ruby-forum.com/t/rspec-tmbundle/122812 "2007-12-12T19:12:16Z")

</div>

I tried checking it out today using instructions here: http://rspec.rubyforge.org/tools/extensions/editors/textmate.html I get a ‘svn: Connection closed unexpectedly’. Did it move or is it down? Nathan S. removed\_e…

---

## [Rspec and rad-rails](https://www.ruby-forum.com/t/rspec-and-rad-rails/122864)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 0\
**Last updated:** [December 12, 2007, 6:59pm UTC](https://www.ruby-forum.com/t/rspec-and-rad-rails/122864 "2007-12-12T18:59:31Z")

</div>

Quick announcement: I wrote a small enhancement to TestUnitRunner.rb to allow RadRails to run both Test::Unit cases and RSpec examples in the fancy pants GUI runner. Chris will be merging it in with future releases o…

---

## [Alternate file jump in Textmate](https://www.ruby-forum.com/t/alternate-file-jump-in-textmate/122839)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 0\
**Last updated:** [December 12, 2007, 6:26pm UTC](https://www.ruby-forum.com/t/alternate-file-jump-in-textmate/122839 "2007-12-12T18:26:00Z")

</div>

Hello all, Using RSpec 1.1 RC from the SVN source. Running in Textmate with the bundle, all working good. Got a problem with the Alternate File jump (Ctl Shift DownArrow) because it works fine in Rails with the html…

---

## [Default\_url\_options](https://www.ruby-forum.com/t/default-url-options/122829)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 0\
**Last updated:** [December 12, 2007, 6:11pm UTC](https://www.ruby-forum.com/t/default-url-options/122829 "2007-12-12T18:11:42Z")

</div>

Hi, i recently added a def default\_url\_options to application.rb (used by url\_for , \*\_path etc). My method references request (eg request.domain) . But when I spec a controller, its dies in default\_url\_options with n…

---

## [Fresh rspec on rails install blows up](https://www.ruby-forum.com/t/fresh-rspec-on-rails-install-blows-up/122782)

<div class="topic-metadata">

**Author:** [@Keith\_McDonnell](https://www.ruby-forum.com/u/Keith_McDonnell)\
**Replies:** 3\
**Last updated:** [December 12, 2007, 12:57pm UTC](https://www.ruby-forum.com/t/fresh-rspec-on-rails-install-blows-up/122782 "2007-12-12T12:57:46Z")

</div>

Hi there, I installed the rspec on rails plugin for a new project today and guess what – it blows up! All by other rspec on rails projects are working fine. I updated all gems & still no joy. Any ideas how I can trou…

---

## [Strange error on mock proxy](https://www.ruby-forum.com/t/strange-error-on-mock-proxy/122446)

<div class="topic-metadata">

**Author:** [@brandonpt](https://www.ruby-forum.com/u/brandonpt)\
**Replies:** 4\
**Last updated:** [December 11, 2007, 12:05pm UTC](https://www.ruby-forum.com/t/strange-error-on-mock-proxy/122446 "2007-12-11T12:05:33Z")

</div>

I’m banging my head over this really strange error in a view test when I run “rake spec”. The weird thing is that I don’t get the error when I run the spec file by itself. Here is the spec (I know, fixtures are the d…

---

## [Selenium on Rspec](https://www.ruby-forum.com/t/selenium-on-rspec/122706)

<div class="topic-metadata">

**Author:** [@jimdeuc](https://www.ruby-forum.com/u/jimdeuc)\
**Replies:** 0\
**Last updated:** [December 11, 2007, 2:12am UTC](https://www.ruby-forum.com/t/selenium-on-rspec/122706 "2007-12-11T02:12:39Z")

</div>

http://www.kerrybuckley.com/2007/11/07/driving-selenium-from-the-rspec-story-runner-rbehave found via Bunk and Rambling Â» Readable Selenium tests with rspec

---

## [Duplicate error messages](https://www.ruby-forum.com/t/duplicate-error-messages/122664)

<div class="topic-metadata">

**Author:** [@liseki](https://www.ruby-forum.com/u/liseki)\
**Replies:** 2\
**Last updated:** [December 10, 2007, 4:08pm UTC](https://www.ruby-forum.com/t/duplicate-error-messages/122664 "2007-12-10T16:08:26Z")

</div>

I am running rails 1.2.3 and rspec 1.0.8 on os X 10.4 and I am having a problem with one of my model specs (User class). For some reason rspec is throwing repeating errors. If the error I expect is “email is required”…

---

## [What to test for views?](https://www.ruby-forum.com/t/what-to-test-for-views/122586)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 2\
**Last updated:** [December 10, 2007, 7:09am UTC](https://www.ruby-forum.com/t/what-to-test-for-views/122586 "2007-12-10T07:09:52Z")

</div>

When you guys test views, what are you testing? Do you just test that all the form fields exist in a new.rhtml, that all form fields are filled in an edit.rhtml, and that all the proper columns are are shown in a inde…

---

## [Writing Specifications for Custom Form Builders (and Helpers)](https://www.ruby-forum.com/t/writing-specifications-for-custom-form-builders-and-helpers/122585)

<div class="topic-metadata">

**Author:** [@Andy\_Pearson](https://www.ruby-forum.com/u/Andy_Pearson)\
**Replies:** 0\
**Last updated:** [December 9, 2007, 9:26pm UTC](https://www.ruby-forum.com/t/writing-specifications-for-custom-form-builders-and-helpers/122585 "2007-12-09T21:26:09Z")

</div>

Hello all, Long time reader, first time poster! I am a relative newcomer (no idea what on earth I am doing) to Ruby, Rails and Rspec and have a feeling I am probably trying to run before I know how to walk. I had im…

---

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

<div class="topic-metadata">

**Author:** [@kyleh](https://www.ruby-forum.com/u/kyleh)\
**Replies:** 1\
**Last updated:** [December 9, 2007, 5:33pm UTC](https://www.ruby-forum.com/t/story-html-formatter/122561 "2007-12-09T17:33:04Z")

</div>

I recently noticed the HTML formatter for the story runner, but I’m unable to figure out how to make it function. ‘ruby stories/all.rb --format html’ seems like it should work, in that –help works as expected, but I s…

---

## [TextMate Sidebar](https://www.ruby-forum.com/t/textmate-sidebar/122392)

<div class="topic-metadata">

**Author:** [@meekish](https://www.ruby-forum.com/u/meekish)\
**Replies:** 4\
**Last updated:** [December 7, 2007, 10:22pm UTC](https://www.ruby-forum.com/t/textmate-sidebar/122392 "2007-12-07T22:22:23Z")

</div>

Hey David, I just watched the RubyConf recording of your RSpec session and noticed that you’re using a modified version of TextMate that uses a sidebar instead of a project drawer. Where did you find that mod?

---

## [Rspec\_on\_rails (trunk - r3070) works with Rails 2.0.1](https://www.ruby-forum.com/t/rspec-on-rails-trunk-r3070-works-with-rails-2-0-1/122467)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [December 7, 2007, 8:35pm UTC](https://www.ruby-forum.com/t/rspec-on-rails-trunk-r3070-works-with-rails-2-0-1/122467 "2007-12-07T20:35:41Z")

</div>

After a couple of quick fixes this morning, rspec\_on\_rails (in trunk as of rev 3070) now works correctly with Rails 2.0.1 Now that Rails 2.0 is out, we’ll try to get an RSpec 1.1 release candidate out the door in the …

---

## [Help please](https://www.ruby-forum.com/t/help-please/122430)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [December 7, 2007, 4:00pm UTC](https://www.ruby-forum.com/t/help-please/122430 "2007-12-07T16:00:59Z")

</div>

Hey all, Rails just got tagged 2.0.0, and then 2.0.1. Unfortunately, it includes a changeset from yesterday that breaks rspec’s pre\_commit task. I do not have cycles to address this until tonight, and I suspect that …

---

## [Weird behavior of mocking ruby class methods](https://www.ruby-forum.com/t/weird-behavior-of-mocking-ruby-class-methods/122378)

<div class="topic-metadata">

**Author:** [@Shaker](https://www.ruby-forum.com/u/Shaker)\
**Replies:** 0\
**Last updated:** [December 7, 2007, 3:53am UTC](https://www.ruby-forum.com/t/weird-behavior-of-mocking-ruby-class-methods/122378 "2007-12-07T03:53:35Z")

</div>

Hello everyone: After I played with Rspec for three months, I realized a weird behavior of mocking ruby classes (e.g. File). Please let me post a sample code before I point out the problems: #file\_reader.rb (to be …

---

## [Mock libraries, Object#send, and Object#\_\_send\_\_](https://www.ruby-forum.com/t/mock-libraries-object-send-and-object-send/122357)

<div class="topic-metadata">

**Author:** [@sthorpe](https://www.ruby-forum.com/u/sthorpe)\
**Replies:** 6\
**Last updated:** [December 6, 2007, 11:28pm UTC](https://www.ruby-forum.com/t/mock-libraries-object-send-and-object-send/122357 "2007-12-06T23:28:34Z")

</div>

What is the appropriate way to stub out (and put an expectation on Object#send), without getting warnings from the Rspec mock library? Scott

---

## [Re: Does mock\_model's :null\_object option work?](https://www.ruby-forum.com/t/re-does-mock-models-null-object-option-work/122222)

<div class="topic-metadata">

**Author:** [@Al\_Chou](https://www.ruby-forum.com/u/Al_Chou)\
**Replies:** 0\
**Last updated:** [December 5, 2007, 6:26pm UTC](https://www.ruby-forum.com/t/re-does-mock-models-null-object-option-work/122222 "2007-12-05T18:26:58Z")

</div>

That’s correct, I’m still on 1.0.8. Sorry for forgetting to mention that. I’m trying to keep some semblance of sanity as to knowing what versions of code I’m using, given how scattered I am about a subset of it (viz…

---

## [Re: Does mock\_model's :null\_object option work?](https://www.ruby-forum.com/t/re-does-mock-models-null-object-option-work/122211)

<div class="topic-metadata">

**Author:** [@Al\_Chou](https://www.ruby-forum.com/u/Al_Chou)\
**Replies:** 1\
**Last updated:** [December 5, 2007, 5:00pm UTC](https://www.ruby-forum.com/t/re-does-mock-models-null-object-option-work/122211 "2007-12-05T17:00:05Z")

</div>

Uh, shouldn’t they both work? I use TRUE (and FALSE) because I like the facts that a) they stand out typographically and b) they are Ruby constants. I can’t believe the case of the letters matters, unless you are d…

---

## [AutoTest / Rspec - "stack level too deep"](https://www.ruby-forum.com/t/autotest-rspec-stack-level-too-deep/122143)

<div class="topic-metadata">

**Author:** [@turnkeytraders](https://www.ruby-forum.com/u/turnkeytraders)\
**Replies:** 4\
**Last updated:** [December 5, 2007, 4:58pm UTC](https://www.ruby-forum.com/t/autotest-rspec-stack-level-too-deep/122143 "2007-12-05T16:58:53Z")

</div>

Hello, I’m running AutoTest with Rspec on a Rails application. Every 20 or so runs I get “stack level too deep” on one particular controller stub. Ex. controller.stub!(:login).and\_return(true) This particular line …

---

## [Re: Does mock\_model's :null\_object option work?](https://www.ruby-forum.com/t/re-does-mock-models-null-object-option-work/122212)

<div class="topic-metadata">

**Author:** [@Al\_Chou](https://www.ruby-forum.com/u/Al_Chou)\
**Replies:** 0\
**Last updated:** [December 5, 2007, 4:28pm UTC](https://www.ruby-forum.com/t/re-does-mock-models-null-object-option-work/122212 "2007-12-05T16:28:54Z")

</div>

Cool, I’ll use mock for this purpose in the future! Al ----- Original Message ---- From: Tom S. removed\_email\_address@domain.invalid To: rspec-users removed\_email\_address@domain.invalid Sent: Wednesday, December 5, …

---

## [Does mock\_model's :null\_object option work?](https://www.ruby-forum.com/t/does-mock-models-null-object-option-work/122207)

<div class="topic-metadata">

**Author:** [@Al\_Chou](https://www.ruby-forum.com/u/Al_Chou)\
**Replies:** 5\
**Last updated:** [December 5, 2007, 4:24pm UTC](https://www.ruby-forum.com/t/does-mock-models-null-object-option-work/122207 "2007-12-05T16:24:48Z")

</div>

Please understand in the following that I am making relatively minor changes to legacy (non-TDD/BDD) code in Substruct and don’t have the time to refactor nicely right now. I’m just trying to get past the untested/u…

---

## [Unexpected message on :attr\_accessor](https://www.ruby-forum.com/t/unexpected-message-on-attr-accessor/122123)

<div class="topic-metadata">

**Author:** [@schleg](https://www.ruby-forum.com/u/schleg)\
**Replies:** 10\
**Last updated:** [December 5, 2007, 4:58am UTC](https://www.ruby-forum.com/t/unexpected-message-on-attr-accessor/122123 "2007-12-05T04:58:58Z")

</div>

This may be a dumb noob issue, but I haven’t found any answers while seaching the forum– I have a controller method def edit @user = User.find params\[:id\] @user.password\_confirmation = @user.password end The User…

---

## [Re: params not available for controller specs?](https://www.ruby-forum.com/t/re-params-not-available-for-controller-specs/122164)

<div class="topic-metadata">

**Author:** [@Al\_Chou](https://www.ruby-forum.com/u/Al_Chou)\
**Replies:** 0\
**Last updated:** [December 5, 2007, 3:23am UTC](https://www.ruby-forum.com/t/re-params-not-available-for-controller-specs/122164 "2007-12-05T03:23:01Z")

</div>

OK, I see your strategy now. Rather than mock the String argument, mock Order to confirm that it gets called with an array. Nice! Al ----- Original Message ---- From: Jarkko L. removed\_email\_address@domain.invalid …

---

## [Shared behaviour for all views](https://www.ruby-forum.com/t/shared-behaviour-for-all-views/122149)

<div class="topic-metadata">

**Author:** [@edward](https://www.ruby-forum.com/u/edward)\
**Replies:** 0\
**Last updated:** [December 4, 2007, 11:28pm UTC](https://www.ruby-forum.com/t/shared-behaviour-for-all-views/122149 "2007-12-04T23:28:09Z")

</div>

Is there a way I can write something like a shared behaviour for all views that just checks the page responds with a 200 status and has a title, meta tags, and an h1? Here’s an idea for a shared behaviour (that only…

---

## [Re: params not available for controller specs?](https://www.ruby-forum.com/t/re-params-not-available-for-controller-specs/122144)

<div class="topic-metadata">

**Author:** [@Al\_Chou](https://www.ruby-forum.com/u/Al_Chou)\
**Replies:** 1\
**Last updated:** [December 4, 2007, 10:57pm UTC](https://www.ruby-forum.com/t/re-params-not-available-for-controller-specs/122144 "2007-12-04T22:57:37Z")

</div>

I think Jarkko is saying that no spec should have been written for the code I was trying to fix/change. I’m not sure I would agree that BDD/RSpec is an inappropriate tool for documenting what I was trying to change, …

---

## [Svn: Connection closed unexpectedly when getting trunk](https://www.ruby-forum.com/t/svn-connection-closed-unexpectedly-when-getting-trunk/122134)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 3\
**Last updated:** [December 4, 2007, 10:52pm UTC](https://www.ruby-forum.com/t/svn-connection-closed-unexpectedly-when-getting-trunk/122134 "2007-12-04T22:52:10Z")

</div>

Is anyone else getting this message? With rails 2.0 pre-releases it looks like you also have to be working with the latest version of rpsec. $ ruby script/plugin install svn://rubyforge.org/var/svn/rspec/trunk/rspec …

---

## [Re: params not available for controller specs?](https://www.ruby-forum.com/t/re-params-not-available-for-controller-specs/122133)

<div class="topic-metadata">

**Author:** [@Al\_Chou](https://www.ruby-forum.com/u/Al_Chou)\
**Replies:** 1\
**Last updated:** [December 4, 2007, 9:24pm UTC](https://www.ruby-forum.com/t/re-params-not-available-for-controller-specs/122133 "2007-12-04T21:24:59Z")

</div>

I get what you’re saying, but I was trying to fix a bug in existing code in Substruct (that I did not write) that was caused by Rails passing the array as a /-delimited string and then not automatically decoding that…

---

## [Re: params not available for controller specs?](https://www.ruby-forum.com/t/re-params-not-available-for-controller-specs/122107)

<div class="topic-metadata">

**Author:** [@Al\_Chou](https://www.ruby-forum.com/u/Al_Chou)\
**Replies:** 1\
**Last updated:** [December 4, 2007, 7:11pm UTC](https://www.ruby-forum.com/t/re-params-not-available-for-controller-specs/122107 "2007-12-04T19:11:32Z")

</div>

Going back to my original message, I have the following at the beginning of the download method: def download @orders = Order.find( params\[:ids\] ) … The problem is that params\[:ids\], although built as an Array objec…

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

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