# RSpec

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

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

---

## [Rspec 'mock' method not found](https://www.ruby-forum.com/t/rspec-mock-method-not-found/152435)

<div class="topic-metadata">

**Author:** [@ddancer](https://www.ruby-forum.com/u/ddancer)\
**Replies:** 0\
**Last updated:** [November 3, 2008, 10:47pm UTC](https://www.ruby-forum.com/t/rspec-mock-method-not-found/152435 "2008-11-03T22:47:37Z")

</div>

Hi, I’m having trouble with “mock” and I can’t seem to find any reason for this. The error… NoMethodError in ‘UserObserver should not call UserMailer.deliver\_activation if user wasn’t recently activated’ undef…

---

## [Expected "with" matches received "with" in error message](https://www.ruby-forum.com/t/expected-with-matches-received-with-in-error-message/152403)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 4\
**Last updated:** [November 3, 2008, 5:01pm UTC](https://www.ruby-forum.com/t/expected-with-matches-received-with-in-error-message/152403 "2008-11-03T17:01:40Z")

</div>

I am trying to spec a controller that sets up a page to add two instances of an object to another (many to many :through). In my controller\_spec, I have the following statements: Student.should\_receive(:new).and\_ret…

---

## [Problem running "rake spec" with Workling and Starling](https://www.ruby-forum.com/t/problem-running-rake-spec-with-workling-and-starling/152363)

<div class="topic-metadata">

**Author:** [@tadatoshi](https://www.ruby-forum.com/u/tadatoshi)\
**Replies:** 0\
**Last updated:** [November 3, 2008, 5:58am UTC](https://www.ruby-forum.com/t/problem-running-rake-spec-with-workling-and-starling/152363 "2008-11-03T05:58:09Z")

</div>

Hi, I installed Starling and Workling and set them up. Then when I tried to run “rake spec”, it halts with a message “config/starling.yml configured to connect to starling on localhost:22122 for this environment. co…

---

## [Setting session values](https://www.ruby-forum.com/t/setting-session-values/118245)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 3\
**Last updated:** [November 2, 2008, 4:54pm UTC](https://www.ruby-forum.com/t/setting-session-values/118245 "2008-11-02T16:54:36Z")

</div>

Okay, I give up. I have been trying to set session values in a controller, but no matter what, once the request is made and inside the controller, the session is empty. What’s the correct way? I have tried session\[‘w…

---

## [Cucumber changes between 0.1.8 and edge](https://www.ruby-forum.com/t/cucumber-changes-between-0-1-8-and-edge/152277)

<div class="topic-metadata">

**Author:** [@phylae](https://www.ruby-forum.com/u/phylae)\
**Replies:** 5\
**Last updated:** [November 2, 2008, 12:22pm UTC](https://www.ruby-forum.com/t/cucumber-changes-between-0-1-8-and-edge/152277 "2008-11-02T12:22:23Z")

</div>

When I run rake features after adding cucumber v0.1.8 to my rails app (as a plugin), I get success. But when I upgrade to edge, I get this error: " |/home/paul/sc/ror/cebu\_heroku/vendor/plugins/cucumber/bin/…/lib/cuc…

---

## [Issues after removal of rpsec plugins and gem install](https://www.ruby-forum.com/t/issues-after-removal-of-rpsec-plugins-and-gem-install/152310)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 5\
**Last updated:** [November 1, 2008, 11:38pm UTC](https://www.ruby-forum.com/t/issues-after-removal-of-rpsec-plugins-and-gem-install/152310 "2008-11-01T23:38:09Z")

</div>

autotest will no longer run my tests after I installed the rpsec gem and removed the plugins. I did install the rspec-rails gem as well. Is anyone else having this issue?

---

## [RSpecing a â€˜binaryâ€™](https://www.ruby-forum.com/t/rspecing-a-a-binarya/151765)

<div class="topic-metadata">

**Author:** [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Replies:** 2\
**Last updated:** [November 1, 2008, 10:44pm UTC](https://www.ruby-forum.com/t/rspecing-a-a-binarya/151765 "2008-11-01T22:44:55Z")

</div>

Hello, good folk of rspec-users. Iâ€™m writing my first Ruby â€˜binaryâ€™ (i.e., a script meant to be used as a standalone system command) and Iâ€™m wondering how to RSpec it. (Caveat: With all of my other code I almo…

---

## [Help](https://www.ruby-forum.com/t/help/152295)

<div class="topic-metadata">

**Author:** [@bluestar](https://www.ruby-forum.com/u/bluestar)\
**Replies:** 0\
**Last updated:** [November 1, 2008, 2:31pm UTC](https://www.ruby-forum.com/t/help/152295 "2008-11-01T14:31:48Z")

</div>

Sent from my iPhone.

---

## [Stubbing #javascript\_include\_tag in a helper spec](https://www.ruby-forum.com/t/stubbing-javascript-include-tag-in-a-helper-spec/152261)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 2\
**Last updated:** [October 31, 2008, 11:52pm UTC](https://www.ruby-forum.com/t/stubbing-javascript-include-tag-in-a-helper-spec/152261 "2008-10-31T23:52:33Z")

</div>

When writing specs for a helper method, how do you set an expectation for #javascript\_include\_tag ? describe NeighbourhoodsHelper do describe ‘#initialise\_map’ do it ‘should include the “foo” JS file’ do # expectati…

---

## [Working outside-in with Cucumber and RSpec](https://www.ruby-forum.com/t/working-outside-in-with-cucumber-and-rspec/151771)

<div class="topic-metadata">

**Author:** [@tomx](https://www.ruby-forum.com/u/tomx)\
**Replies:** 33\
**Last updated:** [October 31, 2008, 9:57pm UTC](https://www.ruby-forum.com/t/working-outside-in-with-cucumber-and-rspec/151771 "2008-10-31T21:57:11Z")

</div>

Hi, Going to dive into Cucumber soon, and just reading through all the docs now. Can anyone point to an example of writing Cucumber features first and then “when you get down to nitty gritty details, drop down one a…

---

## [Testing a render layout statement in a controller](https://www.ruby-forum.com/t/testing-a-render-layout-statement-in-a-controller/151041)

<div class="topic-metadata">

**Author:** [@Dave\_Gamphani\_Phiri](https://www.ruby-forum.com/u/Dave_Gamphani_Phiri)\
**Replies:** 3\
**Last updated:** [October 31, 2008, 6:26pm UTC](https://www.ruby-forum.com/t/testing-a-render-layout-statement-in-a-controller/151041 "2008-10-31T18:26:17Z")

</div>

I am new to rSpec and I am writing a test for a controller which has already been developed This is the example in my reports\_controller\_spec.rb: it “should render the layouts/menu template” do get :select\_missing\_pe…

---

## [Described\_type](https://www.ruby-forum.com/t/described-type/152214)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 1\
**Last updated:** [October 31, 2008, 12:07pm UTC](https://www.ruby-forum.com/t/described-type/152214 "2008-10-31T12:07:42Z")

</div>

I heard somebody mention described\_type the other day, so I thought I’d give it a spin. It doesn’t seem to behave as I’m expecting though. I have a method which generates examples to verify AR associations: def …

---

## [Spec'ing the :conditions argument of a find](https://www.ruby-forum.com/t/specing-the-conditions-argument-of-a-find/151969)

<div class="topic-metadata">

**Author:** [@rgagnon](https://www.ruby-forum.com/u/rgagnon)\
**Replies:** 9\
**Last updated:** [October 31, 2008, 9:26am UTC](https://www.ruby-forum.com/t/specing-the-conditions-argument-of-a-find/151969 "2008-10-31T09:26:55Z")

</div>

Let’s see, I want to spec the :conditions args to make sure the right args is passed to the query. Product.find(:all, :conditions =\> \[“inte\_no = ? and vaat\_id\_type\_statut\_pcpa = ?”, inte\_no, 7\], :limit =\> 2, :order…

---

## [Stub followed by should\_receive behavior changed](https://www.ruby-forum.com/t/stub-followed-by-should-receive-behavior-changed/152181)

<div class="topic-metadata">

**Author:** [@lennylmiller](https://www.ruby-forum.com/u/lennylmiller)\
**Replies:** 1\
**Last updated:** [October 30, 2008, 10:31pm UTC](https://www.ruby-forum.com/t/stub-followed-by-should-receive-behavior-changed/152181 "2008-10-30T22:31:20Z")

</div>

I’m in the process of trying to get updated to rspec-1.1.11(from 1.1.1). I have a couple of places where I was trying to verify that a particular collaboration was made inside a transaction. My general strategy was to…

---

## [Mocks and Refactoring - doing it wrong?](https://www.ruby-forum.com/t/mocks-and-refactoring-doing-it-wrong/152113)

<div class="topic-metadata">

**Author:** [@hoshbad](https://www.ruby-forum.com/u/hoshbad)\
**Replies:** 16\
**Last updated:** [October 30, 2008, 9:27pm UTC](https://www.ruby-forum.com/t/mocks-and-refactoring-doing-it-wrong/152113 "2008-10-30T21:27:54Z")

</div>

Hello RSpec folks, I’ve only been introduced to the world of mock objects since Wednesday of last week, so go easy on me if I come off as ignorant. :stuck\_out\_tongue: So, I’m a big fan of testing, especially since it …

---

## [After a step fails, if successive steps have been executed and passed, cucumber reports them as skip](https://www.ruby-forum.com/t/after-a-step-fails-if-successive-steps-have-been-executed-and-passed-cucumber-reports-them-as-skip/152162)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 3\
**Last updated:** [October 30, 2008, 8:34pm UTC](https://www.ruby-forum.com/t/after-a-step-fails-if-successive-steps-have-been-executed-and-passed-cucumber-reports-them-as-skip/152162 "2008-10-30T20:34:19Z")

</div>

Hi, I have a Given step that fails: For that Scenario the remaining Given’s, When, and Then’s are reported as being skipped, even though theses steps have been executed. Why I am not submitting this to Lighthouse, is…

---

## [Mailing list playing catch up with anyone else?](https://www.ruby-forum.com/t/mailing-list-playing-catch-up-with-anyone-else/152149)

<div class="topic-metadata">

**Author:** [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Replies:** 2\
**Last updated:** [October 30, 2008, 4:12pm UTC](https://www.ruby-forum.com/t/mailing-list-playing-catch-up-with-anyone-else/152149 "2008-10-30T16:12:24Z")

</div>

Last night it seemed like the mailing list was playing catchup, as I got a flood of emails from the past few days. Has anyone else seen this?

---

## [\[Cucumber\]: require features from mutliple folders](https://www.ruby-forum.com/t/cucumber-require-features-from-mutliple-folders/152107)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 1\
**Last updated:** [October 30, 2008, 10:39am UTC](https://www.ruby-forum.com/t/cucumber-require-features-from-mutliple-folders/152107 "2008-10-30T10:39:11Z")

</div>

Hi, I have different projects with features related to those projects in different folders /project\_1 /project\_2 /steps The steps cover both projects How do I get Cucumber to require all features within both the p…

---

## [Mocking does not work](https://www.ruby-forum.com/t/mocking-does-not-work/152118)

<div class="topic-metadata">

**Author:** [@leondu](https://www.ruby-forum.com/u/leondu)\
**Replies:** 2\
**Last updated:** [October 30, 2008, 10:33am UTC](https://www.ruby-forum.com/t/mocking-does-not-work/152118 "2008-10-30T10:33:19Z")

</div>

The spec it “should expose a newly created logo as @logo” do Logo.should\_receive(:new).with({‘these’ =\> ‘params’}).and\_return(mock\_logo(:save =\> true)) Logo.should\_receive(:company=).with(mock\_model(Company)) post :c…

---

## [Render\_template return true when only part of template name match. Bug?](https://www.ruby-forum.com/t/render-template-return-true-when-only-part-of-template-name-match-bug/152116)

<div class="topic-metadata">

**Author:** [@wiz](https://www.ruby-forum.com/u/wiz)\
**Replies:** 1\
**Last updated:** [October 30, 2008, 6:43am UTC](https://www.ruby-forum.com/t/render-template-return-true-when-only-part-of-template-name-match-bug/152116 "2008-10-30T06:43:09Z")

</div>

I have this code response.should render\_template(:my\_messages) It returns true also if :messages template rendered. I am confused, is this a bug or expected behavior? Alex

---

## [Including spec/rails/mocks into other classes](https://www.ruby-forum.com/t/including-spec-rails-mocks-into-other-classes/152071)

<div class="topic-metadata">

**Author:** [@cdb](https://www.ruby-forum.com/u/cdb)\
**Replies:** 2\
**Last updated:** [October 30, 2008, 5:56am UTC](https://www.ruby-forum.com/t/including-spec-rails-mocks-into-other-classes/152071 "2008-10-30T05:56:56Z")

</div>

Hi all, So my potentially crazy but I think good idea right now is to take the factory\_girl gem and adapt it to generate stubbed models instead of actual ActiveRecord objects that get saved to the DB. My main reasoni…

---

## [Cucumber step FIT-like tables](https://www.ruby-forum.com/t/cucumber-step-fit-like-tables/151908)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 4\
**Last updated:** [October 30, 2008, 5:53am UTC](https://www.ruby-forum.com/t/cucumber-step-fit-like-tables/151908 "2008-10-30T05:53:26Z")

</div>

Hi, I am having a problem with my Cucumber step FIT-like tables. This is my scenario Scenario: Filter by new files added Given a database update that creates an ExpiryDate that is within 30 days And a logged in OLC…

---

## [Should acceptance tests be run against a production environment?](https://www.ruby-forum.com/t/should-acceptance-tests-be-run-against-a-production-environment/152018)

<div class="topic-metadata">

**Author:** [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Replies:** 9\
**Last updated:** [October 30, 2008, 5:18am UTC](https://www.ruby-forum.com/t/should-acceptance-tests-be-run-against-a-production-environment/152018 "2008-10-30T05:18:21Z")

</div>

When you do end-to-end acceptance testing with Selenium, I think it should be run against a production environment. Not THE production environment, mind you, but simply a new Rails app running with RAILS\_ENV=producti…

---

## [Accessing the model class from within an rspec-rails spec](https://www.ruby-forum.com/t/accessing-the-model-class-from-within-an-rspec-rails-spec/152020)

<div class="topic-metadata">

**Author:** [@cdb](https://www.ruby-forum.com/u/cdb)\
**Replies:** 9\
**Last updated:** [October 30, 2008, 4:46am UTC](https://www.ruby-forum.com/t/accessing-the-model-class-from-within-an-rspec-rails-spec/152020 "2008-10-30T04:46:47Z")

</div>

Hi everybody, New to the list, so apologies if this has been answered elsewhere, but I didn’t find it. I’m trying to build up a plugin of useful rspec macros for rails development, eg. things like: it\_should\_return\_…

---

## [RDoc down](https://www.ruby-forum.com/t/rdoc-down/152108)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 1\
**Last updated:** [October 30, 2008, 4:46am UTC](https://www.ruby-forum.com/t/rdoc-down/152108 "2008-10-30T04:46:47Z")

</div>

Hi I get a 404 here following the expectations page\[1\] to the RDoc\[2\]. Don’t know who maintains this - is it a known problem? Ashley \[1\] http://rspec.info/documentation/expectations.html \[2\] http://rspec.info/rdoc/i…

---

## [Gems installation](https://www.ruby-forum.com/t/gems-installation/151887)

<div class="topic-metadata">

**Author:** [@jmcervera](https://www.ruby-forum.com/u/jmcervera)\
**Replies:** 5\
**Last updated:** [October 30, 2008, 4:40am UTC](https://www.ruby-forum.com/t/gems-installation/151887 "2008-10-30T04:40:21Z")

</div>

Hello. I have a problem trying to use cucumber with webrat. I thought I could use the gems versions of rspec, rspec-rails, cucumber and webrat, in fact I think that I could manage to do it two weeks ago, but now that…

---

## [\-l command line option broken?](https://www.ruby-forum.com/t/l-command-line-option-broken/152015)

<div class="topic-metadata">

**Author:** [@lennylmiller](https://www.ruby-forum.com/u/lennylmiller)\
**Replies:** 2\
**Last updated:** [October 30, 2008, 4:39am UTC](https://www.ruby-forum.com/t/l-command-line-option-broken/152015 "2008-10-30T04:39:11Z")

</div>

true.should be\_true end it "should be another example" do true.should be\_true end end I’m not familiar enough with the rspec code to get to the bottom of this, but I did enough drilling to find its related to …

---

## [Accessing the model class from within an rspec-rails spec](https://www.ruby-forum.com/t/accessing-the-model-class-from-within-an-rspec-rails-spec/152105)

<div class="topic-metadata">

**Author:** [@cdb](https://www.ruby-forum.com/u/cdb)\
**Replies:** 0\
**Last updated:** [October 30, 2008, 4:38am UTC](https://www.ruby-forum.com/t/accessing-the-model-class-from-within-an-rspec-rails-spec/152105 "2008-10-30T04:38:35Z")

</div>

Hi everybody, New to the list, so apologies if this has been answered elsewhere, but I didn’t find it. I’m trying to build up a plugin of useful rspec macros for rails development, eg. things like: it\_should\_return\_s…

---

## [Dreading Controller Specs](https://www.ruby-forum.com/t/dreading-controller-specs/151431)

<div class="topic-metadata">

**Author:** [@rob](https://www.ruby-forum.com/u/rob)\
**Replies:** 9\
**Last updated:** [October 30, 2008, 4:37am UTC](https://www.ruby-forum.com/t/dreading-controller-specs/151431 "2008-10-30T04:37:24Z")

</div>

Hi there, I was look for a little advice really. I’ve been using RSpec for about 4 months now and I find it an absolute joy for model work and a really nice tool it makes everything so much more readable and nicer to …

---

## [\-l command line option broken?](https://www.ruby-forum.com/t/l-command-line-option-broken/152000)

<div class="topic-metadata">

**Author:** [@lennylmiller](https://www.ruby-forum.com/u/lennylmiller)\
**Replies:** 3\
**Last updated:** [October 30, 2008, 4:36am UTC](https://www.ruby-forum.com/t/l-command-line-option-broken/152000 "2008-10-30T04:36:49Z")

</div>

Ooops. I meant the -l option not -n. It seems that ‘-l’ command line option for rspec stopped working as of rspec 1.1.3. I think this may be related to why I can’t get NetBeans to run focussed specs anymore. Does this…

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

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