# RSpec

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

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

---

## [Spec.opts default --load-by and observers](https://www.ruby-forum.com/t/spec-opts-default-load-by-and-observers/120522)

<div class="topic-metadata">

**Author:** [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Replies:** 0\
**Last updated:** [November 17, 2007, 10:33pm UTC](https://www.ruby-forum.com/t/spec-opts-default-load-by-and-observers/120522 "2007-11-17T22:33:14Z")

</div>

When specing observers I usually put them into models directory under / spec. Then, when specs are run observer class can’t be found unless I remove --load-by mtime from spec.opts. My question is what’s the Big Idea b…

---

## [MissingSourceFile spec/rails/story\_adapter.rb](https://www.ruby-forum.com/t/missingsourcefile-spec-rails-story-adapter-rb/120347)

<div class="topic-metadata">

**Author:** [@barsalou](https://www.ruby-forum.com/u/barsalou)\
**Replies:** 2\
**Last updated:** [November 17, 2007, 11:46am UTC](https://www.ruby-forum.com/t/missingsourcefile-spec-rails-story-adapter-rb/120347 "2007-11-17T11:46:00Z")

</div>

I can see that the file story\_adapter.rb isn’t where it is supposed to be, however, I don’t know where it comes from in the first place. Can someone give me a hint here? I installed using: ruby script/plugin install …

---

## [Problem with scope\_out](https://www.ruby-forum.com/t/problem-with-scope-out/120435)

<div class="topic-metadata">

**Author:** [@mattclarkson](https://www.ruby-forum.com/u/mattclarkson)\
**Replies:** 0\
**Last updated:** [November 16, 2007, 10:15pm UTC](https://www.ruby-forum.com/t/problem-with-scope-out/120435 "2007-11-16T22:15:12Z")

</div>

Hi folks, I’ve got a plugin question: recently started using scope\_out, which I dig. It broke my specs, though – now I get an “undefined method scope\_out” error when running specs. I can run script/console and use …

---

## [Rails story runner returning a nil response code](https://www.ruby-forum.com/t/rails-story-runner-returning-a-nil-response-code/120113)

<div class="topic-metadata">

**Author:** [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Replies:** 7\
**Last updated:** [November 16, 2007, 6:05pm UTC](https://www.ruby-forum.com/t/rails-story-runner-returning-a-nil-response-code/120113 "2007-11-16T18:05:57Z")

</div>

Has anyone noticed any problems with the Rails story runner returning a response code of “0” when doing get/post/etc methods? I just grabbed the latest rails/rspec and just started noticing this problem, http://pasti…

---

## [Plain Text Stories Chaining Scenarios](https://www.ruby-forum.com/t/plain-text-stories-chaining-scenarios/120247)

<div class="topic-metadata">

**Author:** [@confundido](https://www.ruby-forum.com/u/confundido)\
**Replies:** 7\
**Last updated:** [November 16, 2007, 8:24am UTC](https://www.ruby-forum.com/t/plain-text-stories-chaining-scenarios/120247 "2007-11-16T08:24:59Z")

</div>

I’m writing a plain text story (testing the waters) and I have scenarios that I need to chain in my specs. Here is what I have so far: Story: User purchasing tshirts As a user I want to checkout So that I can purch…

---

## [How to Run Rails Stories](https://www.ruby-forum.com/t/how-to-run-rails-stories/120349)

<div class="topic-metadata">

**Author:** [@confundido](https://www.ruby-forum.com/u/confundido)\
**Replies:** 3\
**Last updated:** [November 16, 2007, 1:06am UTC](https://www.ruby-forum.com/t/how-to-run-rails-stories/120349 "2007-11-16T01:06:00Z")

</div>

I have non non-plain-text story without any steps\_for, can it be run? If so, how? Thanks, Nate

---

## [Story adapter and SQLite Was:What command to run all stories?](https://www.ruby-forum.com/t/story-adapter-and-sqlite-was-what-command-to-run-all-stories/120314)

<div class="topic-metadata">

**Author:** [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Replies:** 2\
**Last updated:** [November 15, 2007, 8:39pm UTC](https://www.ruby-forum.com/t/story-adapter-and-sqlite-was-what-command-to-run-all-stories/120314 "2007-11-15T20:39:06Z")

</div>

Hi, by switching to MySQL from SQLite, it fixed the problem. I ran rdebug on it and it is trying to call I ActiveRecord::Base.connection.begin\_db\_transaction. from ActiveRecordSafetyListener.scenario\_started. I don’t …

---

## [Trouble using should\_receive](https://www.ruby-forum.com/t/trouble-using-should-receive/120325)

<div class="topic-metadata">

**Author:** [@Glenn\_F](https://www.ruby-forum.com/u/Glenn_F)\
**Replies:** 2\
**Last updated:** [November 15, 2007, 8:04pm UTC](https://www.ruby-forum.com/t/trouble-using-should-receive/120325 "2007-11-15T20:04:37Z")

</div>

I have this code trying to ensure my reset method works. I want to make sure all the participants have their destroy method called. in my spec for Room r = Room.new(:name =\> 'bob') r.save p = Participant.new(:logi…

---

## [What command to run all stories?](https://www.ruby-forum.com/t/what-command-to-run-all-stories/120309)

<div class="topic-metadata">

**Author:** [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Replies:** 5\
**Last updated:** [November 15, 2007, 7:30pm UTC](https://www.ruby-forum.com/t/what-command-to-run-all-stories/120309 "2007-11-15T19:30:37Z")

</div>

Hi, I’ve been following this thread and I can get the example stories to run with the ruby command. But I’ve been unable to get the example from http://blog.davidchelimsky.net/articles/2007/10/25/plain-text-stories-pa…

---

## [Stubbing out required associated models](https://www.ruby-forum.com/t/stubbing-out-required-associated-models/120189)

<div class="topic-metadata">

**Author:** [@turnkeytraders](https://www.ruby-forum.com/u/turnkeytraders)\
**Replies:** 4\
**Last updated:** [November 15, 2007, 2:45pm UTC](https://www.ruby-forum.com/t/stubbing-out-required-associated-models/120189 "2007-11-15T14:45:16Z")

</div>

Hello, As I’m becoming more and more familiar with mocking/stubbing, I’m going back to some of my model specs and revaluating how I wrote them. I have certain models in which validation requires the presence of an a…

---

## [RSpec on Rails 2.0](https://www.ruby-forum.com/t/rspec-on-rails-2-0/119668)

<div class="topic-metadata">

**Author:** [@mark](https://www.ruby-forum.com/u/mark)\
**Replies:** 26\
**Last updated:** [November 15, 2007, 2:13am UTC](https://www.ruby-forum.com/t/rspec-on-rails-2-0/119668 "2007-11-15T02:13:41Z")

</div>

I have a project on edge rails that I’m trying to convert from Test:Unit to rspec. I have the rspec gem version 2338, the rspec and rsepc\_on\_rails version 2831 in vendor/plugins, and rails version 8117 in vendor/ra…

---

## [ETA to Stories](https://www.ruby-forum.com/t/eta-to-stories/120232)

<div class="topic-metadata">

**Author:** [@confundido](https://www.ruby-forum.com/u/confundido)\
**Replies:** 5\
**Last updated:** [November 15, 2007, 1:28am UTC](https://www.ruby-forum.com/t/eta-to-stories/120232 "2007-11-15T01:28:43Z")

</div>

Hey guys, just poppin in to ask if anyone knows when stories will be somewhat stable? We’re starting to use integration tests at work, we’re already using rspec, and I’d like to avoid integration tests if possible. T…

---

## [Interdependency between RSpec files](https://www.ruby-forum.com/t/interdependency-between-rspec-files/120188)

<div class="topic-metadata">

**Author:** [@Glenn\_F](https://www.ruby-forum.com/u/Glenn_F)\
**Replies:** 4\
**Last updated:** [November 14, 2007, 8:14pm UTC](https://www.ruby-forum.com/t/interdependency-between-rspec-files/120188 "2007-11-14T20:14:53Z")

</div>

I run my suite of tests, one test fails. I run that one test file, no tests fail. Something is carrying over between files and I can’t figure out what. I tracked down the problem to the very line it’s occurring on, wi…

---

## [Should receive field\_for failing](https://www.ruby-forum.com/t/should-receive-field-for-failing/120197)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 0\
**Last updated:** [November 14, 2007, 6:28pm UTC](https://www.ruby-forum.com/t/should-receive-field-for-failing/120197 "2007-11-14T18:28:16Z")

</div>

I have a spec that’s not behaving as I’m thinking it should. Here’s the code: http://pastie.caboo.se/117931 it’s failing with: ActionView::TemplateError in ‘customers/new should receive fields\_for’ Mock ‘ActionView:…

---

## [New to rspec, error running "rake rspec" on debian/etch](https://www.ruby-forum.com/t/new-to-rspec-error-running-rake-rspec-on-debian-etch/120130)

<div class="topic-metadata">

**Author:** [@vizda](https://www.ruby-forum.com/u/vizda)\
**Replies:** 2\
**Last updated:** [November 14, 2007, 4:01pm UTC](https://www.ruby-forum.com/t/new-to-rspec-error-running-rake-rspec-on-debian-etch/120130 "2007-11-14T16:01:05Z")

</div>

I have the latest version of rspec and rails-rspec installed. I’m using the debian versions of ruby and rails. On a new project after a generate an “rspec\_model” and then try to run “rake spec”, I get the following …

---

## [Spec slowdown](https://www.ruby-forum.com/t/spec-slowdown/120095)

<div class="topic-metadata">

**Author:** [@jarkko](https://www.ruby-forum.com/u/jarkko)\
**Replies:** 2\
**Last updated:** [November 14, 2007, 12:36pm UTC](https://www.ruby-forum.com/t/spec-slowdown/120095 "2007-11-14T12:36:14Z")

</div>

Is there something currently going on on the rspec trunk that causes a massive slowdown when running rake spec and autotest (without spec\_server)? I updated to the latest trunk yesterday and the time needed to run the…

---

## [Test case for file import](https://www.ruby-forum.com/t/test-case-for-file-import/119345)

<div class="topic-metadata">

**Author:** [@karnirevuri](https://www.ruby-forum.com/u/karnirevuri)\
**Replies:** 10\
**Last updated:** [November 14, 2007, 11:22am UTC](https://www.ruby-forum.com/t/test-case-for-file-import/119345 "2007-11-14T11:22:24Z")

</div>

Hi Friends, I need to write the testcase for fileimport. Pls give me any idea

---

## [Rspec\_on\_rails, receive\_and\_render experiment](https://www.ruby-forum.com/t/rspec-on-rails-receive-and-render-experiment/120151)

<div class="topic-metadata">

**Author:** [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Replies:** 0\
**Last updated:** [November 14, 2007, 6:15am UTC](https://www.ruby-forum.com/t/rspec-on-rails-receive-and-render-experiment/120151 "2007-11-14T06:15:13Z")

</div>

A recent exploration on receive\_and\_render to assist with some common view spec’ing can be found at http://www.continuousthinking.com/2007/11/14/rspec\_on\_rails-render\_and\_receive\_matcher Suggestions and feedback are …

---

## [Re: testing scripts](https://www.ruby-forum.com/t/re-testing-scripts/120131)

<div class="topic-metadata">

**Author:** [@barsalou](https://www.ruby-forum.com/u/barsalou)\
**Replies:** 0\
**Last updated:** [November 14, 2007, 12:53am UTC](https://www.ruby-forum.com/t/re-testing-scripts/120131 "2007-11-14T00:53:08Z")

</div>

Ashley said: Message: 7 Date: Tue, 13 Nov 2007 20:43:53 +0000 From: Ashley M. removed\_email\_address@domain.invalid Subject: Re: \[rspec-users\] testing scripts To: rspec-users removed\_email\_address@domain.invalid Mes…

---

## [Testing scripts](https://www.ruby-forum.com/t/testing-scripts/120108)

<div class="topic-metadata">

**Author:** [@barsalou](https://www.ruby-forum.com/u/barsalou)\
**Replies:** 1\
**Last updated:** [November 13, 2007, 9:44pm UTC](https://www.ruby-forum.com/t/testing-scripts/120108 "2007-11-13T21:44:36Z")

</div>

So in the past I’ve written a script that query’s a remote DB, takes the data, validates it, then does some processing, producing a new file with the data in a completely different format. Since this is a script with …

---

## [Trouble stubbing a method](https://www.ruby-forum.com/t/trouble-stubbing-a-method/120114)

<div class="topic-metadata">

**Author:** [@turnkeytraders](https://www.ruby-forum.com/u/turnkeytraders)\
**Replies:** 2\
**Last updated:** [November 13, 2007, 9:37pm UTC](https://www.ruby-forum.com/t/trouble-stubbing-a-method/120114 "2007-11-13T21:37:00Z")

</div>

Hey guys, I’ll try to explain this without the model code at first, since there is so much, but if need be, I’ll pastie it. I have an Order model that makes API calls to a payment gateway(TrustCommerce) during valid…

---

## [Autotest with rspec HTML output](https://www.ruby-forum.com/t/autotest-with-rspec-html-output/119844)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 8\
**Last updated:** [November 13, 2007, 9:15pm UTC](https://www.ruby-forum.com/t/autotest-with-rspec-html-output/119844 "2007-11-13T21:15:19Z")

</div>

Hey all, I was just wondering if any one has played around with getting autotest’s rspec integration working with rspec’s HTML output. I really like how in the rspec textmate bundle the context of the failing code …

---

## [Story problem if parenthesis used in Given, When, Then or And](https://www.ruby-forum.com/t/story-problem-if-parenthesis-used-in-given-when-then-or-and/120093)

<div class="topic-metadata">

**Author:** [@sinclair\_bain](https://www.ruby-forum.com/u/sinclair_bain)\
**Replies:** 3\
**Last updated:** [November 13, 2007, 6:58pm UTC](https://www.ruby-forum.com/t/story-problem-if-parenthesis-used-in-given-when-then-or-and/120093 "2007-11-13T18:58:41Z")

</div>

VERSION: rspec rails plugin current edge version XP/Cygwin on XP Hi, I hit this when trying to use parenthesis in my stories … (that’ll teach me!). If a scenario looks like the following: Story “User has story wi…

---

## [It "should \[action\] ..." vs it with an active voice](https://www.ruby-forum.com/t/it-should-action-vs-it-with-an-active-voice/119984)

<div class="topic-metadata">

**Author:** [@bct](https://www.ruby-forum.com/u/bct)\
**Replies:** 14\
**Last updated:** [November 13, 2007, 6:21am UTC](https://www.ruby-forum.com/t/it-should-action-vs-it-with-an-active-voice/119984 "2007-11-13T06:21:39Z")

</div>

I’d like to start gathering information/debating on the advantages/disadvantages of using it “should …” vs other techniques. Dan N. explained why we should use should: I used to use it “should …” for the projects I w…

---

## [Fixture\_file\_upload and edge rspec?](https://www.ruby-forum.com/t/fixture-file-upload-and-edge-rspec/119683)

<div class="topic-metadata">

**Author:** [@Leslie\_F](https://www.ruby-forum.com/u/Leslie_F)\
**Replies:** 9\
**Last updated:** [November 13, 2007, 5:46am UTC](https://www.ruby-forum.com/t/fixture-file-upload-and-edge-rspec/119683 "2007-11-13T05:46:00Z")

</div>

Hi all, I had some specs that were using fixture\_file\_upload that were passing just fine. Then I froze edge rails to get some 2.0 functionality, then a I upgraded to trunk rspec to deal with uninitialized constant Ac…

---

## [More Rails Pattern Examples?](https://www.ruby-forum.com/t/more-rails-pattern-examples/120020)

<div class="topic-metadata">

**Author:** [@sorcerous](https://www.ruby-forum.com/u/sorcerous)\
**Replies:** 2\
**Last updated:** [November 13, 2007, 4:42am UTC](https://www.ruby-forum.com/t/more-rails-pattern-examples/120020 "2007-11-13T04:42:20Z")

</div>

Hi, I have been reading the documentation and examples on the rspec site. There are two “patterns” from Rails that I am not clear how to implement that are kind of related, and so I am not sure how to start. Does any…

---

## [Using the mock framework in story runner](https://www.ruby-forum.com/t/using-the-mock-framework-in-story-runner/120005)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 2\
**Last updated:** [November 12, 2007, 10:03pm UTC](https://www.ruby-forum.com/t/using-the-mock-framework-in-story-runner/120005 "2007-11-12T22:03:25Z")

</div>

Hey all, What is the easiest way to include rpec’s mocking framework into a story so I can use it? I want to use it to stub out a Net::HTTP method so I’m not making API calls every time I run my story. :slight\_smile: …

---

## [Getting 'block not supplied' with Rspec](https://www.ruby-forum.com/t/getting-block-not-supplied-with-rspec/119987)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [November 12, 2007, 6:43pm UTC](https://www.ruby-forum.com/t/getting-block-not-supplied-with-rspec/119987 "2007-11-12T18:43:27Z")

</div>

Hi, I am usinh RoR w/ Oracle as my DB. For one my example in spec I get 'block not supplied error: Here is the sample code: Engagements::Engagement.find(:first).project\_id I tried to google but did not find any subs…

---

## [Running specs in reverse](https://www.ruby-forum.com/t/running-specs-in-reverse/119629)

<div class="topic-metadata">

**Author:** [@Alvin\_S](https://www.ruby-forum.com/u/Alvin_S)\
**Replies:** 5\
**Last updated:** [November 12, 2007, 3:58pm UTC](https://www.ruby-forum.com/t/running-specs-in-reverse/119629 "2007-11-12T15:58:50Z")

</div>

There is an option “–reverse” to run examples in the reverse order which is good for detecting inter-dependencies between examples. Is it feasible for rspec to automatically switch between “forward” and “reverse” orde…

---

## [Problem with view spec - works inside the browser but spec fails with nil object](https://www.ruby-forum.com/t/problem-with-view-spec-works-inside-the-browser-but-spec-fails-with-nil-object/119816)

<div class="topic-metadata">

**Author:** [@Caio\_Moritz\_Ronchi](https://www.ruby-forum.com/u/Caio_Moritz_Ronchi)\
**Replies:** 2\
**Last updated:** [November 12, 2007, 2:11am UTC](https://www.ruby-forum.com/t/problem-with-view-spec-works-inside-the-browser-but-spec-fails-with-nil-object/119816 "2007-11-12T02:11:25Z")

</div>

Hi, I’ve been trying to find an answer for this problem in the last couple hours, but I think no discussion was about this exact same thing. So here it goes, hope someone can help. I’m trying to spec a view which wo…

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

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