# RSpec

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

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

---

## [How to spec controller whose route has a different name?](https://www.ruby-forum.com/t/how-to-spec-controller-whose-route-has-a-different-name/133035)

<div class="topic-metadata">

**Author:** [@Wincent\_C](https://www.ruby-forum.com/u/Wincent_C)\
**Replies:** 0\
**Last updated:** [March 26, 2008, 10:35pm UTC](https://www.ruby-forum.com/t/how-to-spec-controller-whose-route-has-a-different-name/133035 "2008-03-26T22:35:13Z")

</div>

Perhaps I am missing something extremely obvious, but I am unable to get my specs to work for an ArticlesController which is accessed using URLs like “/wiki/foo”. Here’s the corresponding line from config/routes.rb: m…

---

## [Testing controller without integrate views](https://www.ruby-forum.com/t/testing-controller-without-integrate-views/133034)

<div class="topic-metadata">

**Author:** [@jahrel](https://www.ruby-forum.com/u/jahrel)\
**Replies:** 0\
**Last updated:** [March 26, 2008, 10:29pm UTC](https://www.ruby-forum.com/t/testing-controller-without-integrate-views/133034 "2008-03-26T22:29:56Z")

</div>

Hello, I’m new to RSpec and I’m having some trouble testing controllers. After a lot of testing without coming any closer to a solution, I figured I should try describing the problem here. Any help will be appreciate…

---

## [Pending plain text story step](https://www.ruby-forum.com/t/pending-plain-text-story-step/132930)

<div class="topic-metadata">

**Author:** [@visage](https://www.ruby-forum.com/u/visage)\
**Replies:** 2\
**Last updated:** [March 26, 2008, 4:09pm UTC](https://www.ruby-forum.com/t/pending-plain-text-story-step/132930 "2008-03-26T16:09:46Z")

</div>

\#pending works when creating a step for a plain text story, but adding text to the method call doesn’t spit it out in the output. Is this a bug, or are we doing something wrong? Then(“blah”) do pending “waiting for…

---

## [Plaint Text Stories Comments in output?](https://www.ruby-forum.com/t/plaint-text-stories-comments-in-output/132902)

<div class="topic-metadata">

**Author:** [@visage](https://www.ruby-forum.com/u/visage)\
**Replies:** 2\
**Last updated:** [March 25, 2008, 7:59pm UTC](https://www.ruby-forum.com/t/plaint-text-stories-comments-in-output/132902 "2008-03-25T19:59:57Z")

</div>

Is there an easy way to get a story output that includes comment text inside the Scenario? For example, I have a scenario like Scenario: User tries to log in with invalid credentials Card: 5732 Given a visitor And…

---

## [HOWTO: RSpec integration with Rails](https://www.ruby-forum.com/t/howto-rspec-integration-with-rails/132914)

<div class="topic-metadata">

**Author:** [@David\_Nolan](https://www.ruby-forum.com/u/David_Nolan)\
**Replies:** 0\
**Last updated:** [March 25, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/howto-rspec-integration-with-rails/132914 "2008-03-25T19:11:29Z")

</div>

Hi, I’ve hacked together a setup to load an RSpec backtrace into jEdit (in other words, you’ll be able to click the relevant failed behaviour or error to go straight the relevant file and line). More info here: htt…

---

## [Testing Controllers with respond\_to?](https://www.ruby-forum.com/t/testing-controllers-with-respond-to/132839)

<div class="topic-metadata">

**Author:** [@Seth\_L](https://www.ruby-forum.com/u/Seth_L)\
**Replies:** 6\
**Last updated:** [March 25, 2008, 6:17pm UTC](https://www.ruby-forum.com/t/testing-controllers-with-respond-to/132839 "2008-03-25T18:17:23Z")

</div>

Hello, I’m having a hard time testing my controllers that use respond\_to. I’m trying to test that I can correctly handle each MIME type on request. For instance, I have this: respond\_to do |format| format.html f…

---

## [Release date for 1.1.4?](https://www.ruby-forum.com/t/release-date-for-1-1-4/132865)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 2\
**Last updated:** [March 25, 2008, 2:46pm UTC](https://www.ruby-forum.com/t/release-date-for-1-1-4/132865 "2008-03-25T14:46:09Z")

</div>

Hi Does anyone have an idea when RSpec 1.1.4 will be released? It has a bug fix I really want - just bought a USB-controller LED traffic light but RSpec 1.1.3 never fires the :red hook so I just get a green light c…

---

## [\[Stories\]Troubles with GivenScenario](https://www.ruby-forum.com/t/stories-troubles-with-givenscenario/132855)

<div class="topic-metadata">

**Author:** [@bastien-vaucher](https://www.ruby-forum.com/u/bastien-vaucher)\
**Replies:** 4\
**Last updated:** [March 25, 2008, 1:02pm UTC](https://www.ruby-forum.com/t/stories-troubles-with-givenscenario/132855 "2008-03-25T13:02:20Z")

</div>

I have some problems with GivenScenario, my scenario keeps on failing when I use GivenScenario, like if the database or the session was not in the same state at the beginning of the new scenario as it was at the end o…

---

## [\[Q\] how do I test the behavior of a Builder pattern object?](https://www.ruby-forum.com/t/q-how-do-i-test-the-behavior-of-a-builder-pattern-object/132822)

<div class="topic-metadata">

**Author:** [@cremes](https://www.ruby-forum.com/u/cremes)\
**Replies:** 4\
**Last updated:** [March 25, 2008, 6:06am UTC](https://www.ruby-forum.com/t/q-how-do-i-test-the-behavior-of-a-builder-pattern-object/132822 "2008-03-25T06:06:35Z")

</div>

So I have a complex object that I need to construct. This complex object, at runtime, takes an object in its initializer. The initializer interrogates the object and creates several collaborative objects based upon va…

---

## [Has anyone seen this strange mock behaviour?](https://www.ruby-forum.com/t/has-anyone-seen-this-strange-mock-behaviour/132773)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 2\
**Last updated:** [March 24, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/has-anyone-seen-this-strange-mock-behaviour/132773 "2008-03-24T17:32:36Z")

</div>

I’ve got this example ‘group’: before(:all) do @mock\_user = mock\_model(User) @mock\_email\_field = mock\_model(EmailField, :user =\> @mock\_user) @mock\_email\_field.stub!(:user).and\_return(@mock\_user) EmailField.stub!(:fi…

---

## [Does one use mocks in stories?](https://www.ruby-forum.com/t/does-one-use-mocks-in-stories/132715)

<div class="topic-metadata">

**Author:** [@Alan\_Larkin](https://www.ruby-forum.com/u/Alan_Larkin)\
**Replies:** 0\
**Last updated:** [March 23, 2008, 10:44pm UTC](https://www.ruby-forum.com/t/does-one-use-mocks-in-stories/132715 "2008-03-23T22:44:08Z")

</div>

My site is an external Facebook app. I need users to come to the start page and if they are not already logged into their Facebook account (and have the app installed) see a button to take them to the Facebook login/…

---

## [Multiple should sentences one lambda](https://www.ruby-forum.com/t/multiple-should-sentences-one-lambda/132687)

<div class="topic-metadata">

**Author:** [@roberto\_belardo](https://www.ruby-forum.com/u/roberto_belardo)\
**Replies:** 1\
**Last updated:** [March 23, 2008, 4:43pm UTC](https://www.ruby-forum.com/t/multiple-should-sentences-one-lambda/132687 "2008-03-23T16:43:40Z")

</div>

Hi all, i have one problem. I’m just trying to get the restful\_authentication plugin work, but i discovered that its rspec tests are not working, because of this: it ‘requires password confirmation’ do lambda do u …

---

## [What is your workflow? Or how to use the story runner the right way](https://www.ruby-forum.com/t/what-is-your-workflow-or-how-to-use-the-story-runner-the-right-way/130920)

<div class="topic-metadata">

**Author:** [@mlangenberg](https://www.ruby-forum.com/u/mlangenberg)\
**Replies:** 9\
**Last updated:** [March 23, 2008, 3:01am UTC](https://www.ruby-forum.com/t/what-is-your-workflow-or-how-to-use-the-story-runner-the-right-way/130920 "2008-03-23T03:01:13Z")

</div>

I really would like to know how people are using the Story and Example runner to write their software.It would be great to get some direction on it, because I think I’m missing some points. Taking the outside-in appr…

---

## [Foreign characters in strings](https://www.ruby-forum.com/t/foreign-characters-in-strings/132655)

<div class="topic-metadata">

**Author:** [@dave](https://www.ruby-forum.com/u/dave)\
**Replies:** 1\
**Last updated:** [March 22, 2008, 7:12pm UTC](https://www.ruby-forum.com/t/foreign-characters-in-strings/132655 "2008-03-22T19:12:35Z")

</div>

Hi there, I have a test that checks to make sure a string has been URI.unescape’d. I’m testing two different strings. One string that I’m dealing with contains foreign characters, and the other string contains ‘regul…

---

## [Pending Scenarios](https://www.ruby-forum.com/t/pending-scenarios/132554)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 8\
**Last updated:** [March 21, 2008, 7:55pm UTC](https://www.ruby-forum.com/t/pending-scenarios/132554 "2008-03-21T19:55:18Z")

</div>

Hi there, newb q: The “pending” support for spec’s and steps is nice. I’m just wondering why a scenario itself can’t be pending? I.e. it seems to me like it would be nice to write up scenario titles for scenarios a…

---

## [Sharing story steps](https://www.ruby-forum.com/t/sharing-story-steps/132437)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 5\
**Last updated:** [March 21, 2008, 7:30pm UTC](https://www.ruby-forum.com/t/sharing-story-steps/132437 "2008-03-21T19:30:27Z")

</div>

Hi, How can I have a common set of steps that all my stories share? i.e. My stories often start out looking like this: Given a user Joe Given a user Jordan then: Given(“a user $username”) do |username| @users ||= …

---

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

<div class="topic-metadata">

**Author:** [@combray](https://www.ruby-forum.com/u/combray)\
**Replies:** 10\
**Last updated:** [March 21, 2008, 10:15am UTC](https://www.ruby-forum.com/t/rspec-groups/131325 "2008-03-21T10:15:44Z")

</div>

One of the things I really liked about TestNG was the grouping feature. Are there any plans for rSpec to incorporate that? Is there any way to emulate that functionality in rspec? Will.

---

## [Cleaning up after stories](https://www.ruby-forum.com/t/cleaning-up-after-stories/132432)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 3\
**Last updated:** [March 21, 2008, 7:30am UTC](https://www.ruby-forum.com/t/cleaning-up-after-stories/132432 "2008-03-21T07:30:35Z")

</div>

do I have to manually clear out the database after a story runs? Seems like the data the story left is still in there. Joe

---

## [Oh inheritacne, wherefore art thou](https://www.ruby-forum.com/t/oh-inheritacne-wherefore-art-thou/132525)

<div class="topic-metadata">

**Author:** [@nibble70](https://www.ruby-forum.com/u/nibble70)\
**Replies:** 3\
**Last updated:** [March 21, 2008, 5:21am UTC](https://www.ruby-forum.com/t/oh-inheritacne-wherefore-art-thou/132525 "2008-03-21T05:21:39Z")

</div>

Is there anyway to achieve inheritance of specifications? Suppose I had an action like def index filter = params\[:filter\] ? params\[:filter\] : ‘%’ order = params\[:order\] ? params\[:order\] : ‘created\_at DESC’ @posts = …

---

## [Combining autotest, rspec, rspec\_on\_rails and spec-server](https://www.ruby-forum.com/t/combining-autotest-rspec-rspec-on-rails-and-spec-server/132467)

<div class="topic-metadata">

**Author:** [@acarlos](https://www.ruby-forum.com/u/acarlos)\
**Replies:** 1\
**Last updated:** [March 21, 2008, 5:09am UTC](https://www.ruby-forum.com/t/combining-autotest-rspec-rspec-on-rails-and-spec-server/132467 "2008-03-21T05:09:56Z")

</div>

Hello, I’ve been trying to google the definitive way to combine autotest, rspec, and spec-server, but to no avail. It seems like there are lots of suggestions from old versions. Furthermore, some commands such as rak…

---

## [Stories with selenium and the db](https://www.ruby-forum.com/t/stories-with-selenium-and-the-db/132517)

<div class="topic-metadata">

**Author:** [@Ivo\_D](https://www.ruby-forum.com/u/Ivo_D)\
**Replies:** 1\
**Last updated:** [March 21, 2008, 12:41am UTC](https://www.ruby-forum.com/t/stories-with-selenium-and-the-db/132517 "2008-03-21T00:41:28Z")

</div>

Hi all Tonight I wanted to test out selenium in a story to test some ajax stuff on a page. After struggling for an hour or two with disappearing database objects I found the solution in a blog post by Kerry B… with …

---

## [ApplicationHelper](https://www.ruby-forum.com/t/applicationhelper/132410)

<div class="topic-metadata">

**Author:** [@nzook](https://www.ruby-forum.com/u/nzook)\
**Replies:** 3\
**Last updated:** [March 20, 2008, 7:46pm UTC](https://www.ruby-forum.com/t/applicationhelper/132410 "2008-03-20T19:46:34Z")

</div>

When working with views, I use instance methods of ApplicationHelper: app/helpers/application\_helper.rb: module ApplicationHelper def distribute(total, min, cutof, list) \[1,2,3\] end end app/views/planner/\_mta\_col…

---

## [Command line option to run a story scenario?](https://www.ruby-forum.com/t/command-line-option-to-run-a-story-scenario/132468)

<div class="topic-metadata">

**Author:** [@Martin\_Sadler](https://www.ruby-forum.com/u/Martin_Sadler)\
**Replies:** 0\
**Last updated:** [March 20, 2008, 2:32pm UTC](https://www.ruby-forum.com/t/command-line-option-to-run-a-story-scenario/132468 "2008-03-20T14:32:13Z")

</div>

Hi Folks, Quick question. Anybody know if there is a command line option to run an individual scenario for the given story e.g. something like: ruby stories/my\_story.rb -s “the name of the scenario” Thanks in adv…

---

## ["Why not MockEverthing" or why use fixtures for all tests?](https://www.ruby-forum.com/t/why-not-mockeverthing-or-why-use-fixtures-for-all-tests/132246)

<div class="topic-metadata">

**Author:** [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Replies:** 11\
**Last updated:** [March 19, 2008, 8:22pm UTC](https://www.ruby-forum.com/t/why-not-mockeverthing-or-why-use-fixtures-for-all-tests/132246 "2008-03-19T20:22:02Z")

</div>

Hello fellow RSpec users. Before you all start warming up your flame throwers please let me explain my Subject line. I’ve been working over 4 months on a large Rails project with a few other developers. Test coverag…

---

## [Stub / Mock - A little guidance?](https://www.ruby-forum.com/t/stub-mock-a-little-guidance/132381)

<div class="topic-metadata">

**Author:** [@dave](https://www.ruby-forum.com/u/dave)\
**Replies:** 2\
**Last updated:** [March 19, 2008, 5:37pm UTC](https://www.ruby-forum.com/t/stub-mock-a-little-guidance/132381 "2008-03-19T17:37:43Z")

</div>

Hi there, I’m still trying to wrap my head around when to use a stub and a mock. If I understand this right, I should be using a ‘mock’ when imitating an object, but not its behavior. I should be using a stub when I w…

---

## [Are there hooks to record messages to be displayed after a spec run?](https://www.ruby-forum.com/t/are-there-hooks-to-record-messages-to-be-displayed-after-a-spec-run/132358)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 0\
**Last updated:** [March 19, 2008, 12:17pm UTC](https://www.ruby-forum.com/t/are-there-hooks-to-record-messages-to-be-displayed-after-a-spec-run/132358 "2008-03-19T12:17:32Z")

</div>

Hi I am working on a class for use in spec code that has an “unsafe” version that does not catch common errors. Currently I have it using STDERR.puts to display warning messages, but these scroll past when there ar…

---

## [Rescue](https://www.ruby-forum.com/t/rescue/132316)

<div class="topic-metadata">

**Author:** [@linojon](https://www.ruby-forum.com/u/linojon)\
**Replies:** 2\
**Last updated:** [March 19, 2008, 7:01am UTC](https://www.ruby-forum.com/t/rescue/132316 "2008-03-19T07:01:03Z")

</div>

Hi, whats the correct way to spec a rescue? This will raise it but doesnt test my code’s response controller def edit @foo = Foo.find(params\[:id\]) rescue flash\[:notice\] = “Unknown foo #{params\[:id\]}” redirect\_to fo…

---

## [Svn externals and git submodules](https://www.ruby-forum.com/t/svn-externals-and-git-submodules/132310)

<div class="topic-metadata">

**Author:** [@3nd3r](https://www.ruby-forum.com/u/3nd3r)\
**Replies:** 3\
**Last updated:** [March 19, 2008, 5:44am UTC](https://www.ruby-forum.com/t/svn-externals-and-git-submodules/132310 "2008-03-19T05:44:53Z")

</div>

This is a request to split up the repository into at least two repositories rspec rspec\_core (loaded as svn\_external or git submodule) rspec\_on\_rails (loaded as svn\_external or git submodule) We could load the plugi…

---

## [Am I off track on my testing?](https://www.ruby-forum.com/t/am-i-off-track-on-my-testing/131876)

<div class="topic-metadata">

**Author:** [@sumwutdum](https://www.ruby-forum.com/u/sumwutdum)\
**Replies:** 15\
**Last updated:** [March 19, 2008, 5:22am UTC](https://www.ruby-forum.com/t/am-i-off-track-on-my-testing/131876 "2008-03-19T05:22:00Z")

</div>

Is it just me or does anyone else miss being able to create something quickly. Once you start writing all the tests your time is now increased by a factor of 10. I agree with the logic in testing, but am I doing som…

---

## [Problem with mocking a simple has\_many relationship](https://www.ruby-forum.com/t/problem-with-mocking-a-simple-has-many-relationship/132305)

<div class="topic-metadata">

**Author:** [@demisone](https://www.ruby-forum.com/u/demisone)\
**Replies:** 6\
**Last updated:** [March 19, 2008, 1:04am UTC](https://www.ruby-forum.com/t/problem-with-mocking-a-simple-has-many-relationship/132305 "2008-03-19T01:04:10Z")

</div>

Hi there all. Sorry if the question sounds silly but i’m rather new at the ‘mocking’ stuff… So here is my problem (code helps more than talking): the model: class Item \< ActiveRecord::Base … has\_many :images, :depe…

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

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