# RSpec

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

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

---

## [Verify Order](https://www.ruby-forum.com/t/verify-order/184546)

<div class="topic-metadata">

**Author:** [@fjlj](https://www.ruby-forum.com/u/fjlj)\
**Replies:** 1\
**Last updated:** [March 4, 2010, 7:32am UTC](https://www.ruby-forum.com/t/verify-order/184546 "2010-03-04T07:32:17Z")

</div>

I may be missing something obvious, but how do I verify sort order? I have class Project \< ActiveRecord::Base has\_many :tasks, :order =\> “position” end I create a project, and 2 tasks: one with position = 1 and the …

---

## [Disabling database access in controller specs](https://www.ruby-forum.com/t/disabling-database-access-in-controller-specs/184523)

<div class="topic-metadata">

**Author:** [@stefankroes](https://www.ruby-forum.com/u/stefankroes)\
**Replies:** 1\
**Last updated:** [March 4, 2010, 12:01am UTC](https://www.ruby-forum.com/t/disabling-database-access-in-controller-specs/184523 "2010-03-04T00:01:01Z")

</div>

It took a while, but now I an totally convinced that controller specs should not access the database and stub as much as possible. I’m committed to that style of writing, yet from time to time I incidentally allow it…

---

## [Integration testing without cucumber](https://www.ruby-forum.com/t/integration-testing-without-cucumber/184391)

<div class="topic-metadata">

**Author:** [@drewB](https://www.ruby-forum.com/u/drewB)\
**Replies:** 10\
**Last updated:** [March 3, 2010, 7:41pm UTC](https://www.ruby-forum.com/t/integration-testing-without-cucumber/184391 "2010-03-03T19:41:42Z")

</div>

I need to create some integration tests without cucumber. Can anyone point me in the right direction for how to do that in rails? I tried creating specs under ‘spec/integration/’ but no matchers are being included. …

---

## [RSpec and Watir, easy script structure question](https://www.ruby-forum.com/t/rspec-and-watir-easy-script-structure-question/184452)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 6\
**Last updated:** [March 3, 2010, 5:17pm UTC](https://www.ruby-forum.com/t/rspec-and-watir-easy-script-structure-question/184452 "2010-03-03T17:17:40Z")

</div>

Howdy! I’m relatively new to RSpec, but I’ve worked with Watir and Ruby for about 5 years now. My company is redesigning a web app from the ground up, so I’m taking the opportunity to leverage RSpec instead of Test…

---

## [Hi All](https://www.ruby-forum.com/t/hi-all/184497)

<div class="topic-metadata">

**Author:** [@vtr](https://www.ruby-forum.com/u/vtr)\
**Replies:** 2\
**Last updated:** [March 3, 2010, 4:34pm UTC](https://www.ruby-forum.com/t/hi-all/184497 "2010-03-03T16:34:21Z")

</div>

Hi All, This is Thiyagarajan Veluchamy from India, i am new to rspec. gI need to learn rspec. Can anyone guide me, how to start properly. Advance Thanks, Thanks, Thiyagarajan Veluchamy

---

## [Requiring "test\_notifier/rspec" in spec,opts](https://www.ruby-forum.com/t/requiring-test-notifier-rspec-in-spec-opts/184455)

<div class="topic-metadata">

**Author:** [@drewB](https://www.ruby-forum.com/u/drewB)\
**Replies:** 5\
**Last updated:** [March 3, 2010, 3:01pm UTC](https://www.ruby-forum.com/t/requiring-test-notifier-rspec-in-spec-opts/184455 "2010-03-03T15:01:17Z")

</div>

There is a nice little gem that gives you desktop notifications of your spec commands called test\_noitifer (fnando (Nando Vieira) · GitHub test\_notifier). I can get it to work by including require “test\_notifier/rspe…

---

## [Stub and should\_receive](https://www.ruby-forum.com/t/stub-and-should-receive/184456)

<div class="topic-metadata">

**Author:** [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Replies:** 1\
**Last updated:** [March 2, 2010, 8:46pm UTC](https://www.ruby-forum.com/t/stub-and-should-receive/184456 "2010-03-02T20:46:39Z")

</div>

What is the expected behavior when a model has both stub and should\_receive defined for the same method? I have a helper method which creates an admin “logged in”: def stub\_user(is\_administrator) user = stub\_model(Us…

---

## [RSpec-2 and The RSpec Book](https://www.ruby-forum.com/t/rspec-2-and-the-rspec-book/184434)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 3\
**Last updated:** [March 2, 2010, 5:52pm UTC](https://www.ruby-forum.com/t/rspec-2-and-the-rspec-book/184434 "2010-03-02T17:52:47Z")

</div>

Hey all, I’m happy to announce that The RSpec Book will be updated for RSpec-2 and Rails-3 before its final release. This, of course, means that the print schedule will get pushed back, but we’ll have a couple of more …

---

## [Configuring RSpec 2](https://www.ruby-forum.com/t/configuring-rspec-2/184431)

<div class="topic-metadata">

**Author:** [@kristianm](https://www.ruby-forum.com/u/kristianm)\
**Replies:** 1\
**Last updated:** [March 2, 2010, 3:02pm UTC](https://www.ruby-forum.com/t/configuring-rspec-2/184431 "2010-03-02T15:02:24Z")

</div>

spec\_helper.rb $LOAD\_PATH.unshift(File.dirname(FILE)) $LOAD\_PATH.unshift(File.join(File.dirname(FILE), ‘…’, ‘lib’)) require '… require ‘rspec’ require ‘rspec/autorun’ doesn’t work: just remove it and it works. But h…

---

## [Can have\_selector Match Only Part of an Elements Class String?](https://www.ruby-forum.com/t/can-have-selector-match-only-part-of-an-elements-class-string/184400)

<div class="topic-metadata">

**Author:** [@dans](https://www.ruby-forum.com/u/dans)\
**Replies:** 2\
**Last updated:** [March 2, 2010, 6:30am UTC](https://www.ruby-forum.com/t/can-have-selector-match-only-part-of-an-elements-class-string/184400 "2010-03-02T06:30:50Z")

</div>

I would like to find a way to check for the existence of a class on a element in a calendar. The s are the days of the calendar and can have various classes assigned. I want to test if a day has the 'past' class and …

---

## [STDIN gets method issue with rspec](https://www.ruby-forum.com/t/stdin-gets-method-issue-with-rspec/182120)

<div class="topic-metadata">

**Author:** [@gokulamurthy](https://www.ruby-forum.com/u/gokulamurthy)\
**Replies:** 3\
**Last updated:** [February 28, 2010, 10:53pm UTC](https://www.ruby-forum.com/t/stdin-gets-method-issue-with-rspec/182120 "2010-02-28T22:53:06Z")

</div>

Hi, I am new to rspec. I am trying to write a spec for a simple ruby program i.e class First def test a = gets.chomp return a end end I have tried in different ways test method is called from the spec file. but …

---

## [Cucumber Scenario syntax](https://www.ruby-forum.com/t/cucumber-scenario-syntax/148419)

<div class="topic-metadata">

**Author:** [@elight](https://www.ruby-forum.com/u/elight)\
**Replies:** 17\
**Last updated:** [February 27, 2010, 10:47am UTC](https://www.ruby-forum.com/t/cucumber-scenario-syntax/148419 "2010-02-27T10:47:22Z")

</div>

Last night, I gave a presentation to the DC Ruby U. Group (http://dcrug.org ) on Plain Text Stories with Ruby. I spoke on both RSpec Plain Text Stories, which I have used, and Cucumber which I started to dig into a …

---

## [Error: undefined method \`use\_transactional\_fixtures](https://www.ruby-forum.com/t/error-undefined-method-use-transactional-fixtures/157080)

<div class="topic-metadata">

**Author:** [@waseem\_ahmad](https://www.ruby-forum.com/u/waseem_ahmad)\
**Replies:** 9\
**Last updated:** [February 26, 2010, 8:44pm UTC](https://www.ruby-forum.com/t/error-undefined-method-use-transactional-fixtures/157080 "2010-02-26T20:44:08Z")

</div>

Hi, I get this error when I do $spec /spec/any\_spec /home/waseem/app/spec/spec\_helper.rb:14: undefined method use\_transactional\_fixtures=' for #\<Spec::Example::Configuration:0xb6d9f218\> (NoMethodError) from /us…

---

## [Should\_receive not receiving on a returned instance variable](https://www.ruby-forum.com/t/should-receive-not-receiving-on-a-returned-instance-variable/184176)

<div class="topic-metadata">

**Author:** [@lawwantsin](https://www.ruby-forum.com/u/lawwantsin)\
**Replies:** 1\
**Last updated:** [February 26, 2010, 5:14am UTC](https://www.ruby-forum.com/t/should-receive-not-receiving-on-a-returned-instance-variable/184176 "2010-02-26T05:14:39Z")

</div>

i’m calling a very simple should\_receive method on a returned instance and it’s saying the implementation code is not calling it. i get this error in my specs alot. i’ve read the rspec beta book and it doesn’t menti…

---

## [Matching Rails response to visible text](https://www.ruby-forum.com/t/matching-rails-response-to-visible-text/184162)

<div class="topic-metadata">

**Author:** [@Sean\_DeNigris](https://www.ruby-forum.com/u/Sean_DeNigris)\
**Replies:** 2\
**Last updated:** [February 25, 2010, 9:31pm UTC](https://www.ruby-forum.com/t/matching-rails-response-to-visible-text/184162 "2010-02-25T21:31:07Z")

</div>

Hi, I did a bit of experimenting/Googling for what seems like a common operation, but didn’t like what I found (mostly hand-rolled regexes)… I want to verify response text, but don’t care about the structure. The te…

---

## [Rspec "output which test it is running before running it"](https://www.ruby-forum.com/t/rspec-output-which-test-it-is-running-before-running-it/184133)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 6\
**Last updated:** [February 25, 2010, 7:59pm UTC](https://www.ruby-forum.com/t/rspec-output-which-test-it-is-running-before-running-it/184133 "2010-02-25T19:59:13Z")

</div>

I’m trying to find a spec parameter that will do something like the following $ spec file.spec Spec: running “it should pass spec x” . Spec: running “it should pass spec y” . That type of thing. The use case is t…

---

## [Specify multiple names](https://www.ruby-forum.com/t/specify-multiple-names/184156)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 0\
**Last updated:** [February 25, 2010, 6:58pm UTC](https://www.ruby-forum.com/t/specify-multiple-names/184156 "2010-02-25T18:58:55Z")

</div>

I noticed this in the help -e, --example \[NAME|FILE\_NAME\] Execute example(s) with matching name(s). To me, this seems to imply I can pass more than one name. But that didn’t help me figure out exactly how to do so. …

---

## [Rspec + Shoulda + FactoryGirl = undefined method \`reflect\_on\_association'](https://www.ruby-forum.com/t/rspec-shoulda-factorygirl-undefined-method-reflect-on-association/184065)

<div class="topic-metadata">

**Author:** [@dmht81](https://www.ruby-forum.com/u/dmht81)\
**Replies:** 2\
**Last updated:** [February 25, 2010, 2:03pm UTC](https://www.ruby-forum.com/t/rspec-shoulda-factorygirl-undefined-method-reflect-on-association/184065 "2010-02-25T14:03:16Z")

</div>

I have Rspec + Shoulda + FactoryGirl and I am receiving the following error when attempting to call Shoulda’s have\_many or belong\_to methods. All Shoulda methods used in the “validations” group work fine: \> NoMetho…

---

## [Problem running spec command for directory](https://www.ruby-forum.com/t/problem-running-spec-command-for-directory/183853)

<div class="topic-metadata">

**Author:** [@marcan](https://www.ruby-forum.com/u/marcan)\
**Replies:** 2\
**Last updated:** [February 24, 2010, 4:55pm UTC](https://www.ruby-forum.com/t/problem-running-spec-command-for-directory/183853 "2010-02-24T16:55:37Z")

</div>

Hi, I have a problem running the spec command in Rspec 1.3.0 with a directory as parameter. A spec for a MongoMapper document that works when run directly such as $ spec spec/model/attendant\_spec.rb works fine. But …

---

## [Where can I find a discusion happened earlier](https://www.ruby-forum.com/t/where-can-i-find-a-discusion-happened-earlier/184046)

<div class="topic-metadata">

**Author:** [@manoah](https://www.ruby-forum.com/u/manoah)\
**Replies:** 1\
**Last updated:** [February 24, 2010, 9:41am UTC](https://www.ruby-forum.com/t/where-can-i-find-a-discusion-happened-earlier/184046 "2010-02-24T09:41:07Z")

</div>

I need a look on a definition given for rspec and cucumber earlier by a member in rspec group. Where can I find it Regards, Diwakar

---

## [Testing code that integrates with Rspec](https://www.ruby-forum.com/t/testing-code-that-integrates-with-rspec/184043)

<div class="topic-metadata">

**Author:** [@random52k](https://www.ruby-forum.com/u/random52k)\
**Replies:** 1\
**Last updated:** [February 24, 2010, 8:11am UTC](https://www.ruby-forum.com/t/testing-code-that-integrates-with-rspec/184043 "2010-02-24T08:11:00Z")

</div>

Hey all, I’ve been using Rspec for a while now, but this is the first time I’ve run up against the following problem: how do you use Rspec to test code that uses Rspec? Basically my code takes as input a representat…

---

## [Applying an rspec matcher against the elements of a collection](https://www.ruby-forum.com/t/applying-an-rspec-matcher-against-the-elements-of-a-collection/184001)

<div class="topic-metadata">

**Author:** [@moredip](https://www.ruby-forum.com/u/moredip)\
**Replies:** 4\
**Last updated:** [February 24, 2010, 2:47am UTC](https://www.ruby-forum.com/t/applying-an-rspec-matcher-against-the-elements-of-a-collection/184001 "2010-02-24T02:47:59Z")

</div>

Hi all, I’ve tried to figure out whether rspec has any features to make it easier to make assertions against the elements of a collection, but I haven’t had any luck finding anything so far. I thought I’d explain the…

---

## [Is there a way to terminate a long running spec job](https://www.ruby-forum.com/t/is-there-a-way-to-terminate-a-long-running-spec-job/184012)

<div class="topic-metadata">

**Author:** [@rlw](https://www.ruby-forum.com/u/rlw)\
**Replies:** 2\
**Last updated:** [February 23, 2010, 10:45pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-terminate-a-long-running-spec-job/184012 "2010-02-23T22:45:35Z")

</div>

and still get the output of accumulated errors? My environment is awful, slow, and not modifiable. (Just don’t go there! At least I get to program in Ruby, which makes up for everything else.) So when I see some error…

---

## [Shared Helpers](https://www.ruby-forum.com/t/shared-helpers/183995)

<div class="topic-metadata">

**Author:** [@sthorpe](https://www.ruby-forum.com/u/sthorpe)\
**Replies:** 3\
**Last updated:** [February 23, 2010, 8:15pm UTC](https://www.ruby-forum.com/t/shared-helpers/183995 "2010-02-23T20:15:05Z")

</div>

Has there been any development on shared helpers / it\_should\_behave\_like feature in rspec? I forget the reasons, but I remember a patch for something like this was rejected: it\_should\_behave\_like "an\_entry", :locals …

---

## [\[BDD\] Problems on rspec.info site](https://www.ruby-forum.com/t/bdd-problems-on-rspec-info-site/183987)

<div class="topic-metadata">

**Author:** [@Jon\_Seidel\_CMC](https://www.ruby-forum.com/u/Jon_Seidel_CMC)\
**Replies:** 1\
**Last updated:** [February 23, 2010, 3:26pm UTC](https://www.ruby-forum.com/t/bdd-problems-on-rspec-info-site/183987 "2010-02-23T15:26:29Z")

</div>

Hi… I’ve been studying rspec and found some problems on the rspec.info site: Bad link. On page http://rspec.info/rails/writing/views.html, the link to “Spec::Rails::Expectations” (http://rspec.info/rdoc-rails/index…

---

## [Rails3 + RSpec2 sample project?](https://www.ruby-forum.com/t/rails3-rspec2-sample-project/183068)

<div class="topic-metadata">

**Author:** [@Jacques\_C](https://www.ruby-forum.com/u/Jacques_C)\
**Replies:** 4\
**Last updated:** [February 23, 2010, 1:17am UTC](https://www.ruby-forum.com/t/rails3-rspec2-sample-project/183068 "2010-02-23T01:17:18Z")

</div>

If anyone has any sort of Rails3 + Rspec2 project sort of working, we should get a stripped down sample project on github. Martin did a great one for datamapper: GitHub - snusnu/datamapper\_on\_rails3: Very simple sample…

---

## [Of ActiveRecord, arel, and train wrecks](https://www.ruby-forum.com/t/of-activerecord-arel-and-train-wrecks/183950)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 3\
**Last updated:** [February 23, 2010, 12:43am UTC](https://www.ruby-forum.com/t/of-activerecord-arel-and-train-wrecks/183950 "2010-02-23T00:43:19Z")

</div>

I thought that it might be worth starting a discussion about the best approaches to deal with spec’ing what’s becoming more and more common in apps using active record. It started with named scopes, now we have arel, …

---

## [Module instance variable remains set](https://www.ruby-forum.com/t/module-instance-variable-remains-set/183938)

<div class="topic-metadata">

**Author:** [@harm](https://www.ruby-forum.com/u/harm)\
**Replies:** 2\
**Last updated:** [February 22, 2010, 11:12pm UTC](https://www.ruby-forum.com/t/module-instance-variable-remains-set/183938 "2010-02-22T23:12:35Z")

</div>

Hi, I have an issue with rSpec when spec’ing a module. The module in question looks like this: module Sheep def self.sound @sound ||= produce\_sound() end end This module is used all around the application (and co…

---

## [Undefined method \`has' in integration test](https://www.ruby-forum.com/t/undefined-method-has-in-integration-test/183861)

<div class="topic-metadata">

**Author:** [@drewB](https://www.ruby-forum.com/u/drewB)\
**Replies:** 4\
**Last updated:** [February 22, 2010, 10:29pm UTC](https://www.ruby-forum.com/t/undefined-method-has-in-integration-test/183861 "2010-02-22T22:29:16Z")

</div>

Whenever I use a matcher like response.should have\_text in an integration test I receive the following error: undefined method \`has’ for #\<ActionController::Integration::Session: 0x7fe07d184038\> Any idea why that is …

---

## [Best approach to spec'ing this](https://www.ruby-forum.com/t/best-approach-to-specing-this/183933)

<div class="topic-metadata">

**Author:** [@Matt\_Riches](https://www.ruby-forum.com/u/Matt_Riches)\
**Replies:** 3\
**Last updated:** [February 22, 2010, 10:11pm UTC](https://www.ruby-forum.com/t/best-approach-to-specing-this/183933 "2010-02-22T22:11:07Z")

</div>

I am hoping that this is an easy question to answer! I have 2 models, related via an association model, such that models a and b use has\_many to refer to each other, and also the association. (Thats as simple as the …

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

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