# RSpec

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

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

---

## [Textmate Bundle focussed test](https://www.ruby-forum.com/t/textmate-bundle-focussed-test/170037)

<div class="topic-metadata">

**Author:** [@John\_van\_Dijk](https://www.ruby-forum.com/u/John_van_Dijk)\
**Replies:** 1\
**Last updated:** [June 11, 2009, 4:13pm UTC](https://www.ruby-forum.com/t/textmate-bundle-focussed-test/170037 "2009-06-11T16:13:04Z")

</div>

When running a focussed (single) example in textmate and have no description like this: it { should do\_something } I get not the desired effect :slight\_smile: Is there a way to get this to work? (When running all ex…

---

## [Adding specs to engines](https://www.ruby-forum.com/t/adding-specs-to-engines/169814)

<div class="topic-metadata">

**Author:** [@ru\_ghetto](https://www.ruby-forum.com/u/ru_ghetto)\
**Replies:** 3\
**Last updated:** [June 10, 2009, 8:00pm UTC](https://www.ruby-forum.com/t/adding-specs-to-engines/169814 "2009-06-10T20:00:50Z")

</div>

I am breaking an app into a bunch of rails 2.x style engine plugins. The app is already tested with rspec and I am trying to figure out how to get autotest or even rake spec to run the examples in the plugins. Thanks …

---

## [Before(:all)](https://www.ruby-forum.com/t/before-all/168495)

<div class="topic-metadata">

**Author:** [@lawrence.pit](https://www.ruby-forum.com/u/lawrence.pit)\
**Replies:** 3\
**Last updated:** [June 9, 2009, 4:11pm UTC](https://www.ruby-forum.com/t/before-all/168495 "2009-06-09T16:11:58Z")

</div>

Hi All, When I execute database actions within a before(:each) they are rolled back after each example test has run. I expected that if I execute db actions within a before(:all) they would all be rolled back after al…

---

## [Undefined local variable or method \`params' for #\<Spec](https://www.ruby-forum.com/t/undefined-local-variable-or-method-params-for-spec/165465)

<div class="topic-metadata">

**Author:** [@salil](https://www.ruby-forum.com/u/salil)\
**Replies:** 9\
**Last updated:** [June 8, 2009, 2:57pm UTC](https://www.ruby-forum.com/t/undefined-local-variable-or-method-params-for-spec/165465 "2009-06-08T14:57:45Z")

</div>

following is the method of the helper module ApplicationHelper def tab\_class(tab) ‘class=“active”’ if tab == params\[:controller\] end end i write the spec method as follows describe ApplicationHelper do it “should…

---

## [Rails 2.3.2, rspec routing errors](https://www.ruby-forum.com/t/rails-2-3-2-rspec-routing-errors/169775)

<div class="topic-metadata">

**Author:** [@srinu](https://www.ruby-forum.com/u/srinu)\
**Replies:** 0\
**Last updated:** [June 8, 2009, 2:46pm UTC](https://www.ruby-forum.com/t/rails-2-3-2-rspec-routing-errors/169775 "2009-06-08T14:46:34Z")

</div>

Hi, I have turned my rails application to new version 2.3.2, with this I used to get fixtire\_path error which was resolved by upgrading the plugins spec/spec-rails. Now I struck up with Routing error to run the spec,…

---

## [Rails 2.3.2, rspec routing errors](https://www.ruby-forum.com/t/rails-2-3-2-rspec-routing-errors/169772)

<div class="topic-metadata">

**Author:** [@36srinu](https://www.ruby-forum.com/u/36srinu)\
**Replies:** 1\
**Last updated:** [June 8, 2009, 2:37pm UTC](https://www.ruby-forum.com/t/rails-2-3-2-rspec-routing-errors/169772 "2009-06-08T14:37:47Z")

</div>

Hi, I have turned my rails application to new version 2.3.2, with this I used to get fixtire\_path error which was resolved by upgrading the plugins spec/spec-rails. Now I struck up with Routing error to run the spec…

---

## [Cucumber vs Rails Fixtures](https://www.ruby-forum.com/t/cucumber-vs-rails-fixtures/168434)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 11\
**Last updated:** [June 7, 2009, 7:47pm UTC](https://www.ruby-forum.com/t/cucumber-vs-rails-fixtures/168434 "2009-06-07T19:47:42Z")

</div>

Cucumberists: Apologies for not jumping into some wild alternate fixture (or mock!) system, but the unit tests at my new day gig are \>cough\< hanging by a thread as it is. I need to show off some cute Cuke, without r…

---

## [Example group parallel execution](https://www.ruby-forum.com/t/example-group-parallel-execution/169582)

<div class="topic-metadata">

**Author:** [@objo](https://www.ruby-forum.com/u/objo)\
**Replies:** 3\
**Last updated:** [June 6, 2009, 1:42pm UTC](https://www.ruby-forum.com/t/example-group-parallel-execution/169582 "2009-06-06T13:42:09Z")

</div>

So I am working on a project right now where we are combining Selenium and RSpec. It was working really well until we implemented the grid and started to do parallel execution on the specs to help speed things up. W…

---

## [Driving Out A View - Layouts and Sessions?](https://www.ruby-forum.com/t/driving-out-a-view-layouts-and-sessions/169588)

<div class="topic-metadata">

**Author:** [@lee](https://www.ruby-forum.com/u/lee)\
**Replies:** 4\
**Last updated:** [June 6, 2009, 1:10pm UTC](https://www.ruby-forum.com/t/driving-out-a-view-layouts-and-sessions/169588 "2009-06-06T13:10:29Z")

</div>

I am driving out a view and I want to test that a link is displayed. The link\_to code for the link is included in the layout for the view rather than the view template itself. Here’s my example: it “should display a …

---

## [Driving Out A View - Am I specifying too much?](https://www.ruby-forum.com/t/driving-out-a-view-am-i-specifying-too-much/169589)

<div class="topic-metadata">

**Author:** [@lee](https://www.ruby-forum.com/u/lee)\
**Replies:** 5\
**Last updated:** [June 6, 2009, 7:55am UTC](https://www.ruby-forum.com/t/driving-out-a-view-am-i-specifying-too-much/169589 "2009-06-06T07:55:40Z")

</div>

I am driving out a view that renders a list of items with which a logged in member is associated. Against each item, one or more links may be rendered according to the member’s role with respect to the item (item owne…

---

## [Problems upgrading to Rails-2.3.2/Rspec 1.2.6](https://www.ruby-forum.com/t/problems-upgrading-to-rails-2-3-2-rspec-1-2-6/169631)

<div class="topic-metadata">

**Author:** [@lennylmiller](https://www.ruby-forum.com/u/lennylmiller)\
**Replies:** 1\
**Last updated:** [June 6, 2009, 5:48am UTC](https://www.ruby-forum.com/t/problems-upgrading-to-rails-2-3-2-rspec-1-2-6/169631 "2009-06-06T05:48:18Z")

</div>

jruby-1.3.0 rspec/rspec-rails 1.2.6 I just ran into the ‘Missing template’ thing from the ticket below as well. Is it really that uncommon for a controller action to redirect or explicitly render a different template…

---

## [Given/When/Then blocks on Cucumber](https://www.ruby-forum.com/t/given-when-then-blocks-on-cucumber/169615)

<div class="topic-metadata">

**Author:** [@mauricio](https://www.ruby-forum.com/u/mauricio)\
**Replies:** 3\
**Last updated:** [June 5, 2009, 11:21pm UTC](https://www.ruby-forum.com/t/given-when-then-blocks-on-cucumber/169615 "2009-06-05T23:21:17Z")

</div>

Hello guys, I’ve been looking at Pyccuracy and found the “Given/Then/When” blocks to be very interesting and easier to understand and write, specially when writting scenarios with more than one of those. An example ca…

---

## [Mocking find\_by\_sql](https://www.ruby-forum.com/t/mocking-find-by-sql/169614)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 5\
**Last updated:** [June 5, 2009, 11:18pm UTC](https://www.ruby-forum.com/t/mocking-find-by-sql/169614 "2009-06-05T23:18:19Z")

</div>

Hi, I cannot manage to mock a call to find\_by\_sql. Which class is actually getting called? It is not the model, and I tried ActiveRecord which didn’t work either.

---

## [Response.should be\_success -- what does this prove?](https://www.ruby-forum.com/t/response-should-be-success-what-does-this-prove/169576)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 2\
**Last updated:** [June 5, 2009, 10:28pm UTC](https://www.ruby-forum.com/t/response-should-be-success-what-does-this-prove/169576 "2009-06-05T22:28:40Z")

</div>

Hi – if my controller action already ensures that the correct template is being rendered, what use is speccing that it should also be successful? I do it, but just because I saw someone else do it ages ago. Is there …

---

## [\[rspec\] How to pass route parameters to post method?](https://www.ruby-forum.com/t/rspec-how-to-pass-route-parameters-to-post-method/169323)

<div class="topic-metadata">

**Author:** [@Evgeny\_Bogdanov](https://www.ruby-forum.com/u/Evgeny_Bogdanov)\
**Replies:** 2\
**Last updated:** [June 5, 2009, 3:00pm UTC](https://www.ruby-forum.com/t/rspec-how-to-pass-route-parameters-to-post-method/169323 "2009-06-05T15:00:13Z")

</div>

Hello, I am trying to spec an action in a controller, and rspec doesn’t find a route. It seems that problem is in “:viewtype”. If I change a line “/:viewtype/asset/add” into “/context/asset/add” in routes it works. …

---

## [Rspec-rails img src and timestamps](https://www.ruby-forum.com/t/rspec-rails-img-src-and-timestamps/169549)

<div class="topic-metadata">

**Author:** [@amkirwan](https://www.ruby-forum.com/u/amkirwan)\
**Replies:** 2\
**Last updated:** [June 5, 2009, 8:58am UTC](https://www.ruby-forum.com/t/rspec-rails-img-src-and-timestamps/169549 "2009-06-05T08:58:42Z")

</div>

when I run the following matcher bellow it fails because rails adds the timestamp after the file name. I’ve looked around but have not found anyone else having this problem. I am new to rails and rspec so maybe I am c…

---

## [Rspec-rails img src and timestamps](https://www.ruby-forum.com/t/rspec-rails-img-src-and-timestamps/169552)

<div class="topic-metadata">

**Author:** [@amkirwan](https://www.ruby-forum.com/u/amkirwan)\
**Replies:** 0\
**Last updated:** [June 5, 2009, 7:15am UTC](https://www.ruby-forum.com/t/rspec-rails-img-src-and-timestamps/169552 "2009-06-05T07:15:02Z")

</div>

There is probably an easy solution to this but I am new to rails and rspec and after searching I cannot seem to find an answer. When I try the following code: response.should have\_selector("#logo", :src =\> “/images/l…

---

## [Session id in a rails 2.3 app](https://www.ruby-forum.com/t/session-id-in-a-rails-2-3-app/169536)

<div class="topic-metadata">

**Author:** [@chrisfinne](https://www.ruby-forum.com/u/chrisfinne)\
**Replies:** 0\
**Last updated:** [June 4, 2009, 11:27pm UTC](https://www.ruby-forum.com/t/session-id-in-a-rails-2-3-app/169536 "2009-06-04T23:27:59Z")

</div>

I’m in the process of converting an application from an older version of rails to rails 2.3.2, and I’m running into some problems with my specs There’s a part of the application that references the current session ID; …

---

## [Difference between spec:server and autospec](https://www.ruby-forum.com/t/difference-between-spec-server-and-autospec/169476)

<div class="topic-metadata">

**Author:** [@Hunt\_J](https://www.ruby-forum.com/u/Hunt_J)\
**Replies:** 3\
**Last updated:** [June 4, 2009, 10:17am UTC](https://www.ruby-forum.com/t/difference-between-spec-server-and-autospec/169476 "2009-06-04T10:17:03Z")

</div>

What’s the difference between spec:server and autospec? I understand spec:server is only for a Rails project while autospec can work with any projects. I read http://wiki.github.com/dchelimsky/rspec/spec\_server-autos…

---

## [New Zentest, any feedback?](https://www.ruby-forum.com/t/new-zentest-any-feedback/169430)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 1\
**Last updated:** [June 3, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/new-zentest-any-feedback/169430 "2009-06-03T23:32:44Z")

</div>

So I notice that Ryan released a new zentest gem today. It looks like it has been refactored a bit. Are there any brave guinea pigs/canaries in the RSpec/Cucumber community who have tried it out? Any issues? I do see…

---

## [Mock should receive no messages?](https://www.ruby-forum.com/t/mock-should-receive-no-messages/169441)

<div class="topic-metadata">

**Author:** [@hoshbad](https://www.ruby-forum.com/u/hoshbad)\
**Replies:** 7\
**Last updated:** [June 3, 2009, 8:40pm UTC](https://www.ruby-forum.com/t/mock-should-receive-no-messages/169441 "2009-06-03T20:40:22Z")

</div>

Hello all, Is there a way to explicitly tell a mock to expect no messages and give an error if it does? I believe this is the default behavior, but thought it might be nice for code readers to see. Thank you!

---

## [Having autospec run tests?](https://www.ruby-forum.com/t/having-autospec-run-tests/169440)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 2\
**Last updated:** [June 3, 2009, 8:34pm UTC](https://www.ruby-forum.com/t/having-autospec-run-tests/169440 "2009-06-03T20:34:31Z")

</div>

Hi, On one project, I have cucumber features and test/unit (well, i guess activesupport::testcase) tests. I really like how: AUTOFEATURE=true autospec works on my projects that use rspec and cucumber. Can I get tha…

---

## [Infoworld article on BDD](https://www.ruby-forum.com/t/infoworld-article-on-bdd/169424)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [June 3, 2009, 4:42pm UTC](https://www.ruby-forum.com/t/infoworld-article-on-bdd/169424 "2009-06-03T16:42:20Z")

</div>

infoworld article on BDD Good article other than “Behavior” (sans u) and “BDD insists on inside-out.”

---

## [Autospec runs failing specs forever in endless loop](https://www.ruby-forum.com/t/autospec-runs-failing-specs-forever-in-endless-loop/169219)

<div class="topic-metadata">

**Author:** [@juuser](https://www.ruby-forum.com/u/juuser)\
**Replies:** 5\
**Last updated:** [June 2, 2009, 6:23pm UTC](https://www.ruby-forum.com/t/autospec-runs-failing-specs-forever-in-endless-loop/169219 "2009-06-02T18:23:23Z")

</div>

I wanted to start using autospec on my little (non-Rails) project. I’m on Windows XP and have used it some time ago successfully (on the same PC), although I’ve updated many gems in the meantime (RSpec for example amo…

---

## [Does rspec support something like Assumptions in JUnit 4.4?](https://www.ruby-forum.com/t/does-rspec-support-something-like-assumptions-in-junit-4-4/169248)

<div class="topic-metadata">

**Author:** [@mortench](https://www.ruby-forum.com/u/mortench)\
**Replies:** 9\
**Last updated:** [June 1, 2009, 10:59pm UTC](https://www.ruby-forum.com/t/does-rspec-support-something-like-assumptions-in-junit-4-4/169248 "2009-06-01T22:59:03Z")

</div>

JUnit 4.4+ has a feature called assumptions and I am looking for something similar in rspec so that I can express that my examples require a specific environment variable to be specified for testing to make sense. Ab…

---

## [Any way to continue on Assertion Failure](https://www.ruby-forum.com/t/any-way-to-continue-on-assertion-failure/168884)

<div class="topic-metadata">

**Author:** [@figo2476](https://www.ruby-forum.com/u/figo2476)\
**Replies:** 6\
**Last updated:** [June 1, 2009, 9:03pm UTC](https://www.ruby-forum.com/t/any-way-to-continue-on-assertion-failure/168884 "2009-06-01T21:03:23Z")

</div>

Hi, I wonder if there is any way to tell the test script to continue even when encountering an assertion failure? The reason I am asking this is because I have a test flow that can take a long time to run and it woul…

---

## [Specifying mocks](https://www.ruby-forum.com/t/specifying-mocks/169095)

<div class="topic-metadata">

**Author:** [@tomx](https://www.ruby-forum.com/u/tomx)\
**Replies:** 3\
**Last updated:** [May 30, 2009, 10:14am UTC](https://www.ruby-forum.com/t/specifying-mocks/169095 "2009-05-30T10:14:54Z")

</div>

Hi, One of the problems with mocks, as far as I can tell, is that they might go out of sync with the real object they’re mocking. Is it possible and sane to detect this by running each spec against its corresponding …

---

## [Nil object error](https://www.ruby-forum.com/t/nil-object-error/169103)

<div class="topic-metadata">

**Author:** [@manoah](https://www.ruby-forum.com/u/manoah)\
**Replies:** 1\
**Last updated:** [May 29, 2009, 1:57pm UTC](https://www.ruby-forum.com/t/nil-object-error/169103 "2009-05-29T13:57:58Z")

</div>

– Controller ---- def create @avatars = Avatar.find( :all, :conditions =\> { :user\_id =\> 0 } ) @avatars.concat( user.avatars ) end — spec — describe UserAvatarsController do describe :create do before(:each) do …

---

## [Disabling cucumber for autotest](https://www.ruby-forum.com/t/disabling-cucumber-for-autotest/169036)

<div class="topic-metadata">

**Author:** [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Replies:** 4\
**Last updated:** [May 28, 2009, 8:54pm UTC](https://www.ruby-forum.com/t/disabling-cucumber-for-autotest/169036 "2009-05-28T20:54:45Z")

</div>

Hi, For some reason, no matter what, my entire cucumber suite is ran after every auto test. Is there a way to make auto test ignore cucumber all together? Thanks for your help. Ben J. Binary Logic W: www.binarylog…

---

## [Cucumber-java](https://www.ruby-forum.com/t/cucumber-java/168145)

<div class="topic-metadata">

**Author:** [@bigbrother2](https://www.ruby-forum.com/u/bigbrother2)\
**Replies:** 18\
**Last updated:** [May 28, 2009, 5:38pm UTC](https://www.ruby-forum.com/t/cucumber-java/168145 "2009-05-28T17:38:44Z")

</div>

Hi all, Does anyone have an example of how to get the cucumber-java simple example running? I would like to use cucumber-java but cannot figure out how. I’ve gem installed cucumber and cucumber-java. When I run mvn c…

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

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