# RSpec

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

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

---

## [\[cucumber\] getting scenario name in hook](https://www.ruby-forum.com/t/cucumber-getting-scenario-name-in-hook/162584)

<div class="topic-metadata">

**Author:** [@twaters](https://www.ruby-forum.com/u/twaters)\
**Replies:** 6\
**Last updated:** [March 20, 2009, 5:48pm UTC](https://www.ruby-forum.com/t/cucumber-getting-scenario-name-in-hook/162584 "2009-03-20T17:48:54Z")

</div>

Hi Guys, If I am generating diagnostics from a before do step can I get the name of the scenario? Many thanks, Tim

---

## [Problem spec'ing ActionMailer with attachment, body not getting 	rendered](https://www.ruby-forum.com/t/problem-specing-actionmailer-with-attachment-body-not-getting-rendered/163282)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 4\
**Last updated:** [March 20, 2009, 5:06pm UTC](https://www.ruby-forum.com/t/problem-specing-actionmailer-with-attachment-body-not-getting-rendered/163282 "2009-03-20T17:06:42Z")

</div>

I’ve got a simple ActionMailer::Base subclass: class InfoMailer \< ActionMailer::Base def info(user, zip\_name) recipients user.email subject "Requested Info" attachment(:content\_type =\> "application/zip", :f…

---

## [RSpec style and truthiness](https://www.ruby-forum.com/t/rspec-style-and-truthiness/163409)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 10\
**Last updated:** [March 20, 2009, 4:58pm UTC](https://www.ruby-forum.com/t/rspec-style-and-truthiness/163409 "2009-03-20T16:58:26Z")

</div>

I like to avoid over-constraining specifications, so for example of methods which return ‘boolean’ values, I prefer to test either truthiness (anything but false or nil), or falsiness (either false or nil). This isn…

---

## [Bypass\_rescue and its inverse](https://www.ruby-forum.com/t/bypass-rescue-and-its-inverse/163422)

<div class="topic-metadata">

**Author:** [@lodestone](https://www.ruby-forum.com/u/lodestone)\
**Replies:** 1\
**Last updated:** [March 20, 2009, 3:08pm UTC](https://www.ruby-forum.com/t/bypass-rescue-and-its-inverse/163422 "2009-03-20T15:08:03Z")

</div>

Hey, I’ve just started using rspec-rails 1.2 and the bypass rescue declaration is wonderful - by default I tend to write controller which raise exceptions (in exceptional circumstances), along with before- filters as…

---

## [\[cucumber\] Creating an item without worrying about validity?](https://www.ruby-forum.com/t/cucumber-creating-an-item-without-worrying-about-validity/163439)

<div class="topic-metadata">

**Author:** [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Replies:** 1\
**Last updated:** [March 20, 2009, 2:18pm UTC](https://www.ruby-forum.com/t/cucumber-creating-an-item-without-worrying-about-validity/163439 "2009-03-20T14:18:41Z")

</div>

In order to check at the cucumber level if permissions are working correctly I am trying to write a cucumber scenario that tests if a logged in user can create a certain model. The step I am trying to implement is ‘Wh…

---

## [Basic help](https://www.ruby-forum.com/t/basic-help/163329)

<div class="topic-metadata">

**Author:** [@jazzezravi](https://www.ruby-forum.com/u/jazzezravi)\
**Replies:** 4\
**Last updated:** [March 20, 2009, 4:57am UTC](https://www.ruby-forum.com/t/basic-help/163329 "2009-03-20T04:57:47Z")

</div>

Hi All, Just now I installed rspec1.2.0 and dependencies Tried the 2 programs mentioned in http://rspec.info/. bowling\_spec.rb require ‘bowling’ describe Bowling do before(:each) do @bowling = Bowling.new e…

---

## [ANN Cucumber 0.2.0](https://www.ruby-forum.com/t/ann-cucumber-0-2-0/163269)

<div class="topic-metadata">

**Author:** [@aslakhellesoy](https://www.ruby-forum.com/u/aslakhellesoy)\
**Replies:** 11\
**Last updated:** [March 19, 2009, 11:19pm UTC](https://www.ruby-forum.com/t/ann-cucumber-0-2-0/163269 "2009-03-19T23:19:15Z")

</div>

I’m happy to announce the release of Cucumber 0.2.0. There are a some really exciting new features in this release. Some of the ones I find most valuable are: tags better output autoformatting of features better i18…

---

## [\[Cucumber\] Feature vs. Scenario](https://www.ruby-forum.com/t/cucumber-feature-vs-scenario/163381)

<div class="topic-metadata">

**Author:** [@lennylmiller](https://www.ruby-forum.com/u/lennylmiller)\
**Replies:** 2\
**Last updated:** [March 19, 2009, 11:17pm UTC](https://www.ruby-forum.com/t/cucumber-feature-vs-scenario/163381 "2009-03-19T23:17:29Z")

</div>

I’m curious what other people’s thoughts are about when to use Features vs. Scenarios and how much it matters. I’m getting the sense that the line is a thin one, and has more to do with complexity/time to develop than…

---

## [\[rspec\] Stubbing partials in view specs](https://www.ruby-forum.com/t/rspec-stubbing-partials-in-view-specs/158205)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 10\
**Last updated:** [March 19, 2009, 3:52pm UTC](https://www.ruby-forum.com/t/rspec-stubbing-partials-in-view-specs/158205 "2009-03-19T15:52:23Z")

</div>

Hey list, As a good BDDer I want to test my views in isolation. And as a good rails programmer, I separate views into partials when needed. So, when testing my views, I want to stub out rendering of partials in my vi…

---

## [What's the meaning of to\_param?](https://www.ruby-forum.com/t/whats-the-meaning-of-to-param/163345)

<div class="topic-metadata">

**Author:** [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Replies:** 2\
**Last updated:** [March 19, 2009, 2:26pm UTC](https://www.ruby-forum.com/t/whats-the-meaning-of-to-param/163345 "2009-03-19T14:26:32Z")

</div>

usually, I just use this way. ===== @weather = mock\_model(Weather) but recently I saw this. so what’s the :to\_param and :save options meaning? ====== @weather = mock\_model(Weather, :to\_param =\> “1”, :save =\> true)

---

## [Cucumber failing with 'uninitialized constant Spec::Ruby'](https://www.ruby-forum.com/t/cucumber-failing-with-uninitialized-constant-spec-ruby/163281)

<div class="topic-metadata">

**Author:** [@lodestone](https://www.ruby-forum.com/u/lodestone)\
**Replies:** 2\
**Last updated:** [March 19, 2009, 12:18am UTC](https://www.ruby-forum.com/t/cucumber-failing-with-uninitialized-constant-spec-ruby/163281 "2009-03-19T00:18:43Z")

</div>

I’ve just upgraded RSpec to 1.2 on a Rails 2.2.2 app. rake features fails with the following error: /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active\_support/ dependencies.rb:442:in load\_missing\_constant': un…

---

## [Extra spec](https://www.ruby-forum.com/t/extra-spec/163280)

<div class="topic-metadata">

**Author:** [@hayafirst](https://www.ruby-forum.com/u/hayafirst)\
**Replies:** 0\
**Last updated:** [March 18, 2009, 9:53pm UTC](https://www.ruby-forum.com/t/extra-spec/163280 "2009-03-18T21:53:03Z")

</div>

Hi, If I do something like this: before(:each) do @test\_class = Class.new do blahblah end end I will get one extra test shown: MyTest test\_class Where did I go wrong for this? Thanks Yi

---

## [Printing scenario count, pass and fail rather than steps](https://www.ruby-forum.com/t/printing-scenario-count-pass-and-fail-rather-than-steps/163277)

<div class="topic-metadata">

**Author:** [@epirsch](https://www.ruby-forum.com/u/epirsch)\
**Replies:** 0\
**Last updated:** [March 18, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/printing-scenario-count-pass-and-fail-rather-than-steps/163277 "2009-03-18T21:46:33Z")

</div>

Is there a way to do that using some options? I had to override the default reporting in 0.1.16 and prior… But now with 0.2 the formatter look different and was wondering if this is something already possilbe or if I …

---

## [Mock\_model with Rspec/Rspec-rails 1.2 and Rails 2.3](https://www.ruby-forum.com/t/mock-model-with-rspec-rspec-rails-1-2-and-rails-2-3/163198)

<div class="topic-metadata">

**Author:** [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Replies:** 2\
**Last updated:** [March 18, 2009, 6:03pm UTC](https://www.ruby-forum.com/t/mock-model-with-rspec-rspec-rails-1-2-and-rails-2-3/163198 "2009-03-18T18:03:52Z")

</div>

Hi, Not sure if anyone has faced this problem yet and managed to resolve it… I understand Rspec ‘decoupled’ the mock frameworks, however it works fine with Rails 2.2 but fails in 2.3… Can anyone give me any pointers …

---

## [Speccing module which should be included in controller](https://www.ruby-forum.com/t/speccing-module-which-should-be-included-in-controller/163242)

<div class="topic-metadata">

**Author:** [@harm](https://www.ruby-forum.com/u/harm)\
**Replies:** 2\
**Last updated:** [March 18, 2009, 5:59pm UTC](https://www.ruby-forum.com/t/speccing-module-which-should-be-included-in-controller/163242 "2009-03-18T17:59:45Z")

</div>

Dear all, I have a module ApiAccessControl which is included in all controllers which deal with the API. It sees if the users is valid, logs etc etc. I want to see if this module does what it is supposed to but I dont …

---

## [\[Webrat\]\[RSpec\]](https://www.ruby-forum.com/t/webrat-rspec/163096)

<div class="topic-metadata">

**Author:** [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Replies:** 1\
**Last updated:** [March 18, 2009, 5:19am UTC](https://www.ruby-forum.com/t/webrat-rspec/163096 "2009-03-18T05:19:27Z")

</div>

Hi All, Since upgrading rspec to 1.2 I am seeing behavior that a web browser is being opened when there is a problem in a page that a feature visits. Is this behavior intentional and if so can I turn it off. Having th…

---

## [\[Webrat\]\[RSpec\] Features opening browser windows](https://www.ruby-forum.com/t/webrat-rspec-features-opening-browser-windows/163097)

<div class="topic-metadata">

**Author:** [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Replies:** 2\
**Last updated:** [March 17, 2009, 10:28pm UTC](https://www.ruby-forum.com/t/webrat-rspec-features-opening-browser-windows/163097 "2009-03-17T22:28:04Z")

</div>

Apologies for previous message without proper subject Since upgrading rspec to 1.2 I am seeing behavior that a web browser is being opened when there is a problem in a page that a feature visits. Is this behavior inte…

---

## [Is there any way to use a second webrat session temporarily?](https://www.ruby-forum.com/t/is-there-any-way-to-use-a-second-webrat-session-temporarily/163057)

<div class="topic-metadata">

**Author:** [@erik](https://www.ruby-forum.com/u/erik)\
**Replies:** 1\
**Last updated:** [March 17, 2009, 3:00pm UTC](https://www.ruby-forum.com/t/is-there-any-way-to-use-a-second-webrat-session-temporarily/163057 "2009-03-17T15:00:08Z")

</div>

Dear Rspecucumberatubyists, I have a Rails app that creates subdomains, and I’d like to verify them in a cucumber feature like so: When I visit http://blingo.myapp.com Then I should see “Welcome to blingo!” The trou…

---

## [Spec'ing chained calls](https://www.ruby-forum.com/t/specing-chained-calls/162766)

<div class="topic-metadata">

**Author:** [@Levy\_Carneiro\_Jr](https://www.ruby-forum.com/u/Levy_Carneiro_Jr)\
**Replies:** 4\
**Last updated:** [March 17, 2009, 12:40pm UTC](https://www.ruby-forum.com/t/specing-chained-calls/162766 "2009-03-17T12:40:56Z")

</div>

Hello! I’m trying to spec a method, that has several chained calls. 78562’s gists · GitHub (spec) 78563’s gists · GitHub (model) In the first spec, I’m trying to focus on the method calls that have to be made, and …

---

## [Cucumber, watir and new window](https://www.ruby-forum.com/t/cucumber-watir-and-new-window/163078)

<div class="topic-metadata">

**Author:** [@deadinplastic](https://www.ruby-forum.com/u/deadinplastic)\
**Replies:** 0\
**Last updated:** [March 17, 2009, 6:56am UTC](https://www.ruby-forum.com/t/cucumber-watir-and-new-window/163078 "2009-03-17T06:56:39Z")

</div>

Hi, I’m using cucumber and watir and when I want to test i’m on the right page, I use browser.url.should =~ “blah” but how do i test that if the code opens a new window properly? The browser.url is still, correctly,…

---

## [Route failure with Rails2.3 and rspec1.2](https://www.ruby-forum.com/t/route-failure-with-rails2-3-and-rspec1-2/163071)

<div class="topic-metadata">

**Author:** [@pallan](https://www.ruby-forum.com/u/pallan)\
**Replies:** 1\
**Last updated:** [March 17, 2009, 5:26am UTC](https://www.ruby-forum.com/t/route-failure-with-rails2-3-and-rspec1-2/163071 "2009-03-17T05:26:42Z")

</div>

Hello all, I have a spec for a route that used to pass under Rails 2.2.2 and rspec 1.1.12, but can¹t figure out what is wrong since I updated. Here is the assertion: route\_for( { :controller =\> ‘purchase\_or…

---

## [Respond\_to matcher](https://www.ruby-forum.com/t/respond-to-matcher/163068)

<div class="topic-metadata">

**Author:** [@sthorpe](https://www.ruby-forum.com/u/sthorpe)\
**Replies:** 0\
**Last updated:** [March 17, 2009, 4:40am UTC](https://www.ruby-forum.com/t/respond-to-matcher/163068 "2009-03-17T04:40:29Z")

</div>

I noticed this strange behaviour in a spec, and was wondering if it was considered a bug (it certainly took me by surprise): The respond\_to matcher specs seem to show this behaviour as intended: Scott

---

## [Rails 2.3.2 and Cucumber 0.1.16](https://www.ruby-forum.com/t/rails-2-3-2-and-cucumber-0-1-16/163015)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 2\
**Last updated:** [March 16, 2009, 8:32pm UTC](https://www.ruby-forum.com/t/rails-2-3-2-and-cucumber-0-1-16/163015 "2009-03-16T20:32:44Z")

</div>

I am encountering a problem relating to cucumber and Rails 2.3.2 which has something to do with Rails 2.3.2 but I am unable, as of yet, to determine exactly what is the cause. Situation: environment.rb RAILS\_GEM\_VERSI…

---

## ['Missing template' when using send\_data to render response](https://www.ruby-forum.com/t/missing-template-when-using-send-data-to-render-response/163000)

<div class="topic-metadata">

**Author:** [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Replies:** 3\
**Last updated:** [March 16, 2009, 3:40pm UTC](https://www.ruby-forum.com/t/missing-template-when-using-send-data-to-render-response/163000 "2009-03-16T15:40:38Z")

</div>

Hi there, Just upgraded to Rails 2.3/RSpec 1.2.0, and I’ve got a controller that uses send\_data to render a response. In the controller spec, I have: controller.should\_receive(:send\_data).with(…) The send\_data metho…

---

## [Custom, nested HTML matchers in RSpec](https://www.ruby-forum.com/t/custom-nested-html-matchers-in-rspec/162362)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 11\
**Last updated:** [March 16, 2009, 12:44am UTC](https://www.ruby-forum.com/t/custom-nested-html-matchers-in-rspec/162362 "2009-03-16T00:44:00Z")

</div>

Zach D. wrote: response.body.should be\_xml\_with do form :action =\> ‘/users’ do fieldset do legend “Personal Information” label “First name” input :type =\> ‘text’, :name =\> ‘user\[first\_name\]’ end end end I …

---

## [How to use different mocking frameworks?](https://www.ruby-forum.com/t/how-to-use-different-mocking-frameworks/162890)

<div class="topic-metadata">

**Author:** [@val](https://www.ruby-forum.com/u/val)\
**Replies:** 7\
**Last updated:** [March 15, 2009, 11:36pm UTC](https://www.ruby-forum.com/t/how-to-use-different-mocking-frameworks/162890 "2009-03-15T23:36:07Z")

</div>

Hi, I’m pretty new to Rspec, so hope someone can help me out with this. I’m leveraging a couple pre-existing applications in my current project, both have fairly robust test suites in Rspec already. However, one is u…

---

## [\[ANN\] rspec-rails 1.2.0 Released](https://www.ruby-forum.com/t/ann-rspec-rails-1-2-0-released/162920)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [March 15, 2009, 8:26pm UTC](https://www.ruby-forum.com/t/ann-rspec-rails-1-2-0-released/162920 "2009-03-15T20:26:32Z")

</div>

rspec-rails version 1.2.0 has been released! http://rspec.info/ http://wiki.github.com/dchelimsky/rspec http://wiki.github.com/dchelimsky/rspec/rails http://wiki.github.com/dchelimsky/rspec/upgrades Behaviour Driven D…

---

## [Cucumber - Adding a step definition](https://www.ruby-forum.com/t/cucumber-adding-a-step-definition/162805)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 16\
**Last updated:** [March 15, 2009, 8:10pm UTC](https://www.ruby-forum.com/t/cucumber-adding-a-step-definition/162805 "2009-03-15T20:10:02Z")

</div>

List, Quick question about Cucumber/Gherkin. I’m considering adding ‘With’ as a step definition to support scenarios like: Given a policy With a PCF practice state And a secondary risk … I’m fairly new to ruby - …

---

## [Evgeny.zislis has invited you to Spokeo](https://www.ruby-forum.com/t/evgeny-zislis-has-invited-you-to-spokeo/162916)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [March 15, 2009, 6:39pm UTC](https://www.ruby-forum.com/t/evgeny-zislis-has-invited-you-to-spokeo/162916 "2009-03-15T18:39:24Z")

</div>

Hi rspec-users, removed\_email\_address@domain.invalid has invited you to try Spokeo, which finds your friends’ updates across the Web. Your friends are already using Spokeo to follow you on Web Results. Try Spokeo t…

---

## [Rspec and EventMachine](https://www.ruby-forum.com/t/rspec-and-eventmachine/162891)

<div class="topic-metadata">

**Author:** [@julien51](https://www.ruby-forum.com/u/julien51)\
**Replies:** 1\
**Last updated:** [March 15, 2009, 4:57pm UTC](https://www.ruby-forum.com/t/rspec-and-eventmachine/162891 "2009-03-15T16:57:46Z")

</div>

Hey Guys, I am trying to create a app that makes use of EventMachine. As I recently fell in love with Rspec, I was trying to use it with our EM. However, I have no idea how to do this. Also, I want to remove network …

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

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