# RSpec

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

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

---

## [Message expectations without explicit receiver](https://www.ruby-forum.com/t/message-expectations-without-explicit-receiver/165252)

<div class="topic-metadata">

**Author:** [@barunio](https://www.ruby-forum.com/u/barunio)\
**Replies:** 8\
**Last updated:** [April 11, 2009, 12:17am UTC](https://www.ruby-forum.com/t/message-expectations-without-explicit-receiver/165252 "2009-04-11T00:17:08Z")

</div>

A model I’m trying to spec looks something like this class MyClass def methodA do some stuff methodB end def methodB do some stuff end end my spec looks something like this: x = MyClass.new x.should\_receive(:…

---

## [Eliminating duplication from tests](https://www.ruby-forum.com/t/eliminating-duplication-from-tests/165207)

<div class="topic-metadata">

**Author:** [@devbanana](https://www.ruby-forum.com/u/devbanana)\
**Replies:** 7\
**Last updated:** [April 10, 2009, 3:28pm UTC](https://www.ruby-forum.com/t/eliminating-duplication-from-tests/165207 "2009-04-10T15:28:03Z")

</div>

Hi, Lately I’ve found myself trying to reduce typing as much as possible, so when I have a lot of tests that only differ in a few variables, I tend to abstract them to reduce typing. For instance, I have an assert\_f…

---

## [\[Cucumber\] Bug?](https://www.ruby-forum.com/t/cucumber-bug/165141)

<div class="topic-metadata">

**Author:** [@ffomenko](https://www.ruby-forum.com/u/ffomenko)\
**Replies:** 3\
**Last updated:** [April 10, 2009, 3:28pm UTC](https://www.ruby-forum.com/t/cucumber-bug/165141 "2009-04-10T15:28:02Z")

</div>

Hello, I have the following step for checking that a validation message is displayed on screen: Then /^(.+) should be displayed$/ do |error| msg = @browser.ul(:class, ‘validation-summary-errors’).li(:text, error) #…

---

## [Route\_for testing multiple request methods](https://www.ruby-forum.com/t/route-for-testing-multiple-request-methods/165209)

<div class="topic-metadata">

**Author:** [@devbanana](https://www.ruby-forum.com/u/devbanana)\
**Replies:** 1\
**Last updated:** [April 10, 2009, 9:00am UTC](https://www.ruby-forum.com/t/route-for-testing-multiple-request-methods/165209 "2009-04-10T09:00:17Z")

</div>

Hi, I’m trying to use route\_for to test my routes. I have two routes that have the same path, but different request methods. map.with\_options :controller =\> ‘contact’ do |c| c.contact ‘contact.html’, :action =\> ‘ind…

---

## [Testing helpers that accept a block](https://www.ruby-forum.com/t/testing-helpers-that-accept-a-block/165032)

<div class="topic-metadata">

**Author:** [@devbanana](https://www.ruby-forum.com/u/devbanana)\
**Replies:** 3\
**Last updated:** [April 10, 2009, 12:04am UTC](https://www.ruby-forum.com/t/testing-helpers-that-accept-a-block/165032 "2009-04-10T00:04:36Z")

</div>

Hi, I am trying to write and test a helper that accepts a block. Right now it goes something like this: module ContactHelper Wraps a field with div.error if it has an error. def wrap\_error\_field errors, &block fiel…

---

## [Testing page layouts](https://www.ruby-forum.com/t/testing-page-layouts/165172)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 1\
**Last updated:** [April 9, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/testing-page-layouts/165172 "2009-04-09T21:46:49Z")

</div>

This is a question of technique. To what degree do projects generally test page/report layouts? Do you just check to see if the expected data is present or do you also check that the layout is presentable?

---

## [\[cucumber\] Tests pass, application does not](https://www.ruby-forum.com/t/cucumber-tests-pass-application-does-not/165162)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 6\
**Last updated:** [April 9, 2009, 8:15pm UTC](https://www.ruby-forum.com/t/cucumber-tests-pass-application-does-not/165162 "2009-04-09T20:15:15Z")

</div>

This has just cropped up this morning and I have no clue as to what is causing it. Here is the error when running the application through the web browser in development: undefined method \`method\_exists?’ for #Entity:…

---

## [Updated to latest gems, rspec not catching flash.now](https://www.ruby-forum.com/t/updated-to-latest-gems-rspec-not-catching-flash-now/165074)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 2\
**Last updated:** [April 9, 2009, 7:32pm UTC](https://www.ruby-forum.com/t/updated-to-latest-gems-rspec-not-catching-flash-now/165074 "2009-04-09T19:32:23Z")

</div>

Hi, after an update to all the latest gems, I have a controller spec failing that wasn’t previously: flash\[:alert\].should eql( “Blah blah.” )\*\* The flash is being set by “flash.now\[:alert\] = ‘…’” in this instance. C…

---

## [Re: possible to stub params hash?](https://www.ruby-forum.com/t/re-possible-to-stub-params-hash/165164)

<div class="topic-metadata">

**Author:** [@codinggurl](https://www.ruby-forum.com/u/codinggurl)\
**Replies:** 0\
**Last updated:** [April 9, 2009, 6:20pm UTC](https://www.ruby-forum.com/t/re-possible-to-stub-params-hash/165164 "2009-04-09T18:20:15Z")

</div>

The stub for params was the reason, that put :update has called the index action. Now I pass the params directly in and it works fine: put :update, :pl\_planning =\> {“title” =\> “Project 1”} Scott, thanks a lot for the…

---

## [Re: possible to stub params hash?](https://www.ruby-forum.com/t/re-possible-to-stub-params-hash/165150)

<div class="topic-metadata">

**Author:** [@codinggurl](https://www.ruby-forum.com/u/codinggurl)\
**Replies:** 0\
**Last updated:** [April 9, 2009, 4:02pm UTC](https://www.ruby-forum.com/t/re-possible-to-stub-params-hash/165150 "2009-04-09T16:02:20Z")

</div>

Hi, I tried to stub the params method of the Controller because I got the error " You have a nil object when you didn’t expect it!" for the access to params\[:pl\_planning\]\[“item\_model\_version\_id”\] in the update action…

---

## [\[Rspec\] Trying to get rspec to test a controller in a namespace](https://www.ruby-forum.com/t/rspec-trying-to-get-rspec-to-test-a-controller-in-a-namespace/164939)

<div class="topic-metadata">

**Author:** [@tbobker](https://www.ruby-forum.com/u/tbobker)\
**Replies:** 4\
**Last updated:** [April 9, 2009, 10:06am UTC](https://www.ruby-forum.com/t/rspec-trying-to-get-rspec-to-test-a-controller-in-a-namespace/164939 "2009-04-09T10:06:24Z")

</div>

I am trying to get my workflow down and am confused on several fronts. The first is how to get my rspec\_scaffold tests to run. The problem is that i generated my scaffold, then moved my controller into a namespace na…

---

## [Web-based story runner?](https://www.ruby-forum.com/t/web-based-story-runner/164980)

<div class="topic-metadata">

**Author:** [@itsme213](https://www.ruby-forum.com/u/itsme213)\
**Replies:** 4\
**Last updated:** [April 9, 2009, 2:20am UTC](https://www.ruby-forum.com/t/web-based-story-runner/164980 "2009-04-09T02:20:50Z")

</div>

Some time ago I had come across a web-based story editor for scenarios. I’m not sure if it was a full runner, and it was probably before cucumber. Anyone know where I can find it? Thanks

---

## [Debuggin cucmber script in ruby](https://www.ruby-forum.com/t/debuggin-cucmber-script-in-ruby/164837)

<div class="topic-metadata">

**Author:** [@anilg](https://www.ruby-forum.com/u/anilg)\
**Replies:** 10\
**Last updated:** [April 8, 2009, 11:22pm UTC](https://www.ruby-forum.com/t/debuggin-cucmber-script-in-ruby/164837 "2009-04-08T23:22:55Z")

</div>

basically to debug a ruby script we use: ruby -rspecs -rdebug file.rb which would debug ruby script line by line. Is there any such debuging feauture in cucumber.

---

## [Pending expectations](https://www.ruby-forum.com/t/pending-expectations/165024)

<div class="topic-metadata">

**Author:** [@enduro](https://www.ruby-forum.com/u/enduro)\
**Replies:** 6\
**Last updated:** [April 8, 2009, 10:58pm UTC](https://www.ruby-forum.com/t/pending-expectations/165024 "2009-04-08T22:58:51Z")

</div>

I’ve noticed that pending expectations fail if the before(:each) code is not implemented yet. In other words, taking the example code from Peepcode’s rspec series: describe Weather, “.fetch for zipcode” do before(:…

---

## [RSpec-Rails 1.2.2 and Controllers without views - what to do?](https://www.ruby-forum.com/t/rspec-rails-1-2-2-and-controllers-without-views-what-to-do/164492)

<div class="topic-metadata">

**Author:** [@Bira](https://www.ruby-forum.com/u/Bira)\
**Replies:** 1\
**Last updated:** [April 8, 2009, 10:08pm UTC](https://www.ruby-forum.com/t/rspec-rails-1-2-2-and-controllers-without-views-what-to-do/164492 "2009-04-08T22:08:28Z")

</div>

I’m trying to upgrade to RSpec 1.2.2 in a Rails app, and reading Upgrade.rdoc I see that now every controller action must have a corresponding template for their specs to pass. However, we have a few controllers which…

---

## [Rspec\_on\_rails\_on\_crack not being loaded properly](https://www.ruby-forum.com/t/rspec-on-rails-on-crack-not-being-loaded-properly/164984)

<div class="topic-metadata">

**Author:** [@danielpennypacker](https://www.ruby-forum.com/u/danielpennypacker)\
**Replies:** 6\
**Last updated:** [April 8, 2009, 7:32pm UTC](https://www.ruby-forum.com/t/rspec-on-rails-on-crack-not-being-loaded-properly/164984 "2009-04-08T19:32:17Z")

</div>

Here’s an intro to what I’m working on… We’re adding Beast Forums to our site and we decided to integrate the code instead of have it run in a separate app. Beast uses rspec, and this was the first time I’ve been…

---

## [Possible to stub params hash?](https://www.ruby-forum.com/t/possible-to-stub-params-hash/165053)

<div class="topic-metadata">

**Author:** [@codinggurl](https://www.ruby-forum.com/u/codinggurl)\
**Replies:** 1\
**Last updated:** [April 8, 2009, 5:46pm UTC](https://www.ruby-forum.com/t/possible-to-stub-params-hash/165053 "2009-04-08T17:46:41Z")

</div>

Hi, I added one line in my controller to extend the params hash. But now I get errors in my controller spec. Controller def update @pl\_planning = PlPlanning.find(params\[:id\]) the item model version (select box) d…

---

## [\[Cucumber\] Welcome Ben Mabey to the official Cucumber team](https://www.ruby-forum.com/t/cucumber-welcome-ben-mabey-to-the-official-cucumber-team/164981)

<div class="topic-metadata">

**Author:** [@aslakhellesoy](https://www.ruby-forum.com/u/aslakhellesoy)\
**Replies:** 11\
**Last updated:** [April 8, 2009, 9:51am UTC](https://www.ruby-forum.com/t/cucumber-welcome-ben-mabey-to-the-official-cucumber-team/164981 "2009-04-08T09:51:20Z")

</div>

Ben M. has accepted my invitation to be on the core Cucumber team. Ben has been a long time contributor to Cucumber’s ecosystem and knows it inside out. Here is a quote from IRC today: mabes: Yeah but you’re the cuc…

---

## [Rake db:test:prepare and pending migrations](https://www.ruby-forum.com/t/rake-dbprepare-and-pending-migrations/164955)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 3\
**Last updated:** [April 8, 2009, 4:22am UTC](https://www.ruby-forum.com/t/rake-dbprepare-and-pending-migrations/164955 "2009-04-08T04:22:25Z")

</div>

I have run into a minor glitch and would like to know what others think. I am working on a test/expectation and as part of the process of debugging I am rolling back db:migrations one step at a time to discover where…

---

## [(x)HTML Parsing Errors, Cuc 0.2.0 + Rspec 1.2](https://www.ruby-forum.com/t/x-html-parsing-errors-cuc-0-2-0-rspec-1-2/163769)

<div class="topic-metadata">

**Author:** [@pallan](https://www.ruby-forum.com/u/pallan)\
**Replies:** 5\
**Last updated:** [April 7, 2009, 8:09pm UTC](https://www.ruby-forum.com/t/x-html-parsing-errors-cuc-0-2-0-rspec-1-2/163769 "2009-04-07T20:09:46Z")

</div>

Hello all, I have some cucumber features that are making me scratch my head. After updating the Rspec 1.2 my features are now generating thousands of “ignoring attempt to close tag with other tag” when I run them. T…

---

## [\[Rspec\] Trying to get rspec to test a controller in a namespace](https://www.ruby-forum.com/t/rspec-trying-to-get-rspec-to-test-a-controller-in-a-namespace/164943)

<div class="topic-metadata">

**Author:** [@TimBooher](https://www.ruby-forum.com/u/TimBooher)\
**Replies:** 1\
**Last updated:** [April 7, 2009, 6:01pm UTC](https://www.ruby-forum.com/t/rspec-trying-to-get-rspec-to-test-a-controller-in-a-namespace/164943 "2009-04-07T18:01:53Z")

</div>

I am trying to get my workflow down and am confused on several fronts. The first is how to get my rspec\_scaffold tests to run. The problem is that i generated my scaffold, then moved my controller into a namespace nam…

---

## [\[Cucumber\] Spring cleaning](https://www.ruby-forum.com/t/cucumber-spring-cleaning/164928)

<div class="topic-metadata">

**Author:** [@aslakhellesoy](https://www.ruby-forum.com/u/aslakhellesoy)\
**Replies:** 2\
**Last updated:** [April 7, 2009, 4:46pm UTC](https://www.ruby-forum.com/t/cucumber-spring-cleaning/164928 "2009-04-07T16:46:47Z")

</div>

There are a lot of open tickets in Cucumber, and it’s hard for me to know which ones to prioritize. Several of them are either obsolete or not very important. I need your help to decide. I’m therefore going to put …

---

## [Spec'ing theme views](https://www.ruby-forum.com/t/specing-theme-views/164895)

<div class="topic-metadata">

**Author:** [@jared](https://www.ruby-forum.com/u/jared)\
**Replies:** 5\
**Last updated:** [April 7, 2009, 7:10am UTC](https://www.ruby-forum.com/t/specing-theme-views/164895 "2009-04-07T07:10:19Z")

</div>

I’m using the theme support plugin on one of my apps, and I would like to spec the views for each of my themes, but having a little trouble and hoping someone can point me in the right direction. Themed views are loca…

---

## [\[rspec\] Deprecate --dry-run](https://www.ruby-forum.com/t/rspec-deprecate-dry-run/164887)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [April 7, 2009, 2:42am UTC](https://www.ruby-forum.com/t/rspec-deprecate-dry-run/164887 "2009-04-07T02:42:20Z")

</div>

Hey all, Anybody use the --dry-run command line option? I’m planning to deprecate it if nobody has a compelling reason to keep it. Please post your comments in the ticket: https://rspec.lighthouseapp.com/projects/564…

---

## [\[cucumber\] more than one keyword translation](https://www.ruby-forum.com/t/cucumber-more-than-one-keyword-translation/164884)

<div class="topic-metadata">

**Author:** [@ol1barn3s](https://www.ruby-forum.com/u/ol1barn3s)\
**Replies:** 0\
**Last updated:** [April 7, 2009, 1:16am UTC](https://www.ruby-forum.com/t/cucumber-more-than-one-keyword-translation/164884 "2009-04-07T01:16:25Z")

</div>

Hello, I’m trying to get Given in Portuguese to have two translations, “Dado” and “Dada” (variations on gender), so that the features are more readable. so I have this in my languages.yml: given: Dado|Dada (found th…

---

## [A wiki to host Cuke & webrat?](https://www.ruby-forum.com/t/a-wiki-to-host-cuke-webrat/164584)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 5\
**Last updated:** [April 6, 2009, 7:59pm UTC](https://www.ruby-forum.com/t/a-wiki-to-host-cuke-webrat/164584 "2009-04-06T19:59:30Z")

</div>

Would a wiki with these features interest anyone? config.yaml points to your projects serve, highlight, edit & run each Cucumber file paint the tested website in into an iframe update the iframe in realtime as the test…

---

## [\[cucumber\] Nested resource in paths.rb](https://www.ruby-forum.com/t/cucumber-nested-resource-in-paths-rb/164793)

<div class="topic-metadata">

**Author:** [@GMinS\_Morten\_KSHol](https://www.ruby-forum.com/u/GMinS_Morten_KSHol)\
**Replies:** 1\
**Last updated:** [April 6, 2009, 10:59am UTC](https://www.ruby-forum.com/t/cucumber-nested-resource-in-paths-rb/164793 "2009-04-06T10:59:02Z")

</div>

Hello Rspec Users, I was wondering how you specify a nested resource in cucumber. So for example: Given I have a blogpost titled Question For Nice Rspec Users When I am on the list of comments for Question For Nice R…

---

## [\[cucumber\] webrat+selenium integration problem: record not saved to database?](https://www.ruby-forum.com/t/cucumber-webrat-selenium-integration-problem-record-not-saved-to-database/163674)

<div class="topic-metadata">

**Author:** [@balint](https://www.ruby-forum.com/u/balint)\
**Replies:** 14\
**Last updated:** [April 6, 2009, 7:22am UTC](https://www.ruby-forum.com/t/cucumber-webrat-selenium-integration-problem-record-not-saved-to-database/163674 "2009-04-06T07:22:08Z")

</div>

Hey, I am writing a simple cucumber feature for a Rails app to test if the webrat+selenium integration was successful: Scenario: Successful log in Given the user “pepito” exists # (1) And the user “pepito” is active …

---

## [Problem with colorized output in cygwin on Vista (was: RSpec Formats with Strange Characters)](https://www.ruby-forum.com/t/problem-with-colorized-output-in-cygwin-on-vista-was-rspec-formats-with-strange-characters/164773)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 5\
**Last updated:** [April 6, 2009, 4:03am UTC](https://www.ruby-forum.com/t/problem-with-colorized-output-in-cygwin-on-vista-was-rspec-formats-with-strange-characters/164773 "2009-04-06T04:03:36Z")

</div>

Changing the name of this to hopefully catch the eye of other Vista/cygwin/rspec users. On Sun, Apr 5, 2009 at 9:45 AM, Brandon O. removed\_email\_address@domain.invalid wrote: Please describe your environment. OS, v…

---

## [Best practices: How small to make examples?](https://www.ruby-forum.com/t/best-practices-how-small-to-make-examples/164744)

<div class="topic-metadata">

**Author:** [@devbanana](https://www.ruby-forum.com/u/devbanana)\
**Replies:** 10\
**Last updated:** [April 6, 2009, 12:03am UTC](https://www.ruby-forum.com/t/best-practices-how-small-to-make-examples/164744 "2009-04-06T00:03:43Z")

</div>

Hi, How small should examples be? Let’s say I have a form, should there be one example per field? If there’s a dropdown, should I describe the dropdown and have one example per option? I thought that at first but n…

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

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