# RSpec

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

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

---

## [View spec failures without stack traces?!?](https://www.ruby-forum.com/t/view-spec-failures-without-stack-traces/140403)

<div class="topic-metadata">

**Author:** [@mattmcswain](https://www.ruby-forum.com/u/mattmcswain)\
**Replies:** 1\
**Last updated:** [June 13, 2008, 5:05pm UTC](https://www.ruby-forum.com/t/view-spec-failures-without-stack-traces/140403 "2008-06-13T17:05:09Z")

</div>

Hi. I’m getting TemplateErrors from a couple of my view specs with an accompanying message, e.g.: ActionView::TemplateError in ‘playlists/show.rss.builder should render playlist RSS feed’ You have a nil object w…

---

## [Does anyone know how to mock the Rails Logger then set expectations with should\_receive?](https://www.ruby-forum.com/t/does-anyone-know-how-to-mock-the-rails-logger-then-set-expectations-with-should-receive/140334)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 1\
**Last updated:** [June 13, 2008, 1:31am UTC](https://www.ruby-forum.com/t/does-anyone-know-how-to-mock-the-rails-logger-then-set-expectations-with-should-receive/140334 "2008-06-13T01:31:32Z")

</div>

Hey Guys, I’m trying to mock the Rails Logger for the following code: … rescue TimeoutError =\> error $logger.error("#{self.name} Timeout for #{path}: #{error}") and return rescue SocketError =\> error $logger.error…

---

## [Use of 'should' in another thread](https://www.ruby-forum.com/t/use-of-should-in-another-thread/140328)

<div class="topic-metadata">

**Author:** [@liberte](https://www.ruby-forum.com/u/liberte)\
**Replies:** 2\
**Last updated:** [June 13, 2008, 12:55am UTC](https://www.ruby-forum.com/t/use-of-should-in-another-thread/140328 "2008-06-13T00:55:09Z")

</div>

Hi, I’ve tried to find anything about using ‘should’ within a Thread, but it is a little hard do look up there, so I hope you forgive-me if I am asking an “old question”. I guess this spec should fail: describe Thre…

---

## [Mysterious interaction between RSpec 1.1.4 and has\_finder/named\_scope](https://www.ruby-forum.com/t/mysterious-interaction-between-rspec-1-1-4-and-has-finder-named-scope/140323)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 0\
**Last updated:** [June 12, 2008, 11:27pm UTC](https://www.ruby-forum.com/t/mysterious-interaction-between-rspec-1-1-4-and-has-finder-named-scope/140323 "2008-06-12T23:27:05Z")

</div>

I just opened a Rails ticket on a problem with named\_scope in Rails 2.1, and cross-posted a message here which I send to rails-core. I’m still a bit mystified, because I’m having a problem caused by this on RSpec 1.…

---

## [Disregard my map.resources :foo\_items, :as =\> :foo question](https://www.ruby-forum.com/t/disregard-my-map-resources-foo-items-as-foo-question/140309)

<div class="topic-metadata">

**Author:** [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Replies:** 0\
**Last updated:** [June 12, 2008, 9:01pm UTC](https://www.ruby-forum.com/t/disregard-my-map-resources-foo-items-as-foo-question/140309 "2008-06-12T21:01:01Z")

</div>

disregard my map.resources :foo\_items, :as =\> :foo question I was pulling some rookie moves. Thanks Mike – Mike M. Work\> http://sas.quat.ch/ Blog\> http://blog.mondragon.cc/

---

## [After :each invoked before formatter?](https://www.ruby-forum.com/t/after-each-invoked-before-formatter/140264)

<div class="topic-metadata">

**Author:** [@kasutaja](https://www.ruby-forum.com/u/kasutaja)\
**Replies:** 4\
**Last updated:** [June 12, 2008, 5:46pm UTC](https://www.ruby-forum.com/t/after-each-invoked-before-formatter/140264 "2008-06-12T17:46:12Z")

</div>

Hello. I’m using RSpec with Watir to do some automated tests on IE. I’ve ran into problem, where I want to make a screenshot of a browser window when example fails. For that I made custom formatter where in extra\_fa…

---

## [Looking for rspec learning resources](https://www.ruby-forum.com/t/looking-for-rspec-learning-resources/140287)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [June 12, 2008, 5:01pm UTC](https://www.ruby-forum.com/t/looking-for-rspec-learning-resources/140287 "2008-06-12T17:01:20Z")

</div>

Hi, I am at the point in my Rails learning journey where I need to cross the rspec river and need instructions on how to build a boat. Having spent a year learning Rails, one of the biggest traps has been the waste o…

---

## [Map.resources :foo\_items, :as =\> :foo confusing my controller specs](https://www.ruby-forum.com/t/map-resources-foo-items-as-foo-confusing-my-controller-specs/140258)

<div class="topic-metadata">

**Author:** [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Replies:** 1\
**Last updated:** [June 12, 2008, 1:35pm UTC](https://www.ruby-forum.com/t/map-resources-foo-items-as-foo-confusing-my-controller-specs/140258 "2008-06-12T13:35:57Z")

</div>

I have following resource defined in my config/routes.rb (the model name is contrived) map.resources :foo\_items, :as =\> :foo that I originally generated with rspec\_scaffold: ruby script/generate rspec\_scaffold foo\_it…

---

## [Which "get" is being used in Controller spec](https://www.ruby-forum.com/t/which-get-is-being-used-in-controller-spec/140242)

<div class="topic-metadata">

**Author:** [@mschwab](https://www.ruby-forum.com/u/mschwab)\
**Replies:** 1\
**Last updated:** [June 12, 2008, 11:14am UTC](https://www.ruby-forum.com/t/which-get-is-being-used-in-controller-spec/140242 "2008-06-12T11:14:25Z")

</div>

Hi, I’m a bit puzzled with “get” in controller specs. When I write, it “should render index template” do get :index response.should render\_template(:index) end Which “get” method is being used? I checked RDoc of RS…

---

## [Selenium/Watir usage along side Webrat in story testing](https://www.ruby-forum.com/t/selenium-watir-usage-along-side-webrat-in-story-testing/139939)

<div class="topic-metadata">

**Author:** [@joesniff](https://www.ruby-forum.com/u/joesniff)\
**Replies:** 6\
**Last updated:** [June 10, 2008, 9:43pm UTC](https://www.ruby-forum.com/t/selenium-watir-usage-along-side-webrat-in-story-testing/139939 "2008-06-10T21:43:49Z")

</div>

This is related to Selenium/Watir usage along side webrat in story testing. MHS\_Testing and Rspec-ui provide some great help for testing through frameworks like Selenium/Watir. But there is something missing, Webrat …

---

## [Re: RSpec Story - SystemStackError: stack level too	deep](https://www.ruby-forum.com/t/re-rspec-story-systemstackerror-stack-level-too-deep/139870)

<div class="topic-metadata">

**Author:** [@Willem\_van\_den\_Ende](https://www.ruby-forum.com/u/Willem_van_den_Ende)\
**Replies:** 1\
**Last updated:** [June 10, 2008, 7:18pm UTC](https://www.ruby-forum.com/t/re-rspec-story-systemstackerror-stack-level-too-deep/139870 "2008-06-10T19:18:12Z")

</div>

Hi Ben, This is probably not an rspec issue, but a rails defect ( http://dev.rubyonrails.org/ticket/10896 ). From your code, I am assuming you are story testing a Rails app. I was bitten by this too recently… Took m…

---

## [Rspec logging](https://www.ruby-forum.com/t/rspec-logging/140044)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 0\
**Last updated:** [June 10, 2008, 11:31am UTC](https://www.ruby-forum.com/t/rspec-logging/140044 "2008-06-10T11:31:48Z")

</div>

Hi, At the moment I am using the story runner with success. However, I would like to log to XML or HTML. Is there an API for this? Aidy

---

## [Refactoring's code needs refactoring's specs?](https://www.ruby-forum.com/t/refactorings-code-needs-refactorings-specs/140020)

<div class="topic-metadata">

**Author:** [@Gaston\_R](https://www.ruby-forum.com/u/Gaston_R)\
**Replies:** 1\
**Last updated:** [June 10, 2008, 9:04am UTC](https://www.ruby-forum.com/t/refactorings-code-needs-refactorings-specs/140020 "2008-06-10T09:04:38Z")

</div>

Hi guys, I have one question: When refactoring the working code I need or should refactoring the specs too? My old code is: http://pastie.org/private/gpskgtavm4yzutanq1ro3w My new refactored code: http://pastie.org…

---

## [Problems with view spec and mocking will\_paginate](https://www.ruby-forum.com/t/problems-with-view-spec-and-mocking-will-paginate/139798)

<div class="topic-metadata">

**Author:** [@Gaston\_R](https://www.ruby-forum.com/u/Gaston_R)\
**Replies:** 2\
**Last updated:** [June 9, 2008, 2:09pm UTC](https://www.ruby-forum.com/t/problems-with-view-spec-and-mocking-will-paginate/139798 "2008-06-09T14:09:41Z")

</div>

Hi all, I have some failures that not I don’t understand this the pastie with index.erb.html http://pastie.org/private/zgohh6dcts04wpfagfgz5q and this is the pastie for view’s spec: http://pastie.org/210485 and the …

---

## [Full Trace for Stories](https://www.ruby-forum.com/t/full-trace-for-stories/139893)

<div class="topic-metadata">

**Author:** [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Replies:** 2\
**Last updated:** [June 9, 2008, 12:37am UTC](https://www.ruby-forum.com/t/full-trace-for-stories/139893 "2008-06-09T00:37:52Z")

</div>

Does anybody know how to get full backtraces for stories when they fail? I tried ‘ruby stories/all.rb --trace’ but it doesn’t like that option. Thanks, ~ Mark

---

## [Rails integration tests without stories](https://www.ruby-forum.com/t/rails-integration-tests-without-stories/139833)

<div class="topic-metadata">

**Author:** [@kyleh](https://www.ruby-forum.com/u/kyleh)\
**Replies:** 2\
**Last updated:** [June 8, 2008, 2:19am UTC](https://www.ruby-forum.com/t/rails-integration-tests-without-stories/139833 "2008-06-08T02:19:28Z")

</div>

I’m looking to drive the development of a rails app that does nothing but serve a JSON API. All of the models are well tested elsewhere, so I needn’t worry about that. My only immediate goal is to be able to fire off …

---

## [Rcov causing a segmentation fault on rspec 1.1.4 and rails 2.1](https://www.ruby-forum.com/t/rcov-causing-a-segmentation-fault-on-rspec-1-1-4-and-rails-2-1/139826)

<div class="topic-metadata">

**Author:** [@MaurSSS\_cio\_Linhare](https://www.ruby-forum.com/u/MaurSSS_cio_Linhare)\
**Replies:** 2\
**Last updated:** [June 7, 2008, 11:10pm UTC](https://www.ruby-forum.com/t/rcov-causing-a-segmentation-fault-on-rspec-1-1-4-and-rails-2-1/139826 "2008-06-07T23:10:10Z")

</div>

Hello again :slight\_smile: I’m trying to run rcov on my specs here but i’m getting a lot of segmentation faults (and they usually happen at different places): /home/mauricio/NetBeansProjects/reeds/vendor/rails/activer…

---

## [Match render :nothing](https://www.ruby-forum.com/t/match-render-nothing/139823)

<div class="topic-metadata">

**Author:** [@MaurSSS\_cio\_Linhare](https://www.ruby-forum.com/u/MaurSSS_cio_Linhare)\
**Replies:** 3\
**Last updated:** [June 7, 2008, 7:12pm UTC](https://www.ruby-forum.com/t/match-render-nothing/139823 "2008-06-07T19:12:37Z")

</div>

Hello guys, Is there any way to match a render :nothing? I coudn’t find any way to do this so i’ve just changed my controllers to do a “head :ok”, but it would be nice to know if there is any other way :slight\_smile: …

---

## [When to send "post" and "get" in blocks](https://www.ruby-forum.com/t/when-to-send-post-and-get-in-blocks/139800)

<div class="topic-metadata">

**Author:** [@mschwab](https://www.ruby-forum.com/u/mschwab)\
**Replies:** 2\
**Last updated:** [June 7, 2008, 6:20am UTC](https://www.ruby-forum.com/t/when-to-send-post-and-get-in-blocks/139800 "2008-06-07T06:20:48Z")

</div>

Hi, I’m new to RSpec. I have a question about how to write controller specs. Here’s a code generated by scaffolding (with Rspec). def do\_get get :index end it "should be successful" do do\_get response.should be…

---

## [RSpec for testing REST webservices? (Not Rails)](https://www.ruby-forum.com/t/rspec-for-testing-rest-webservices-not-rails/196688)

<div class="topic-metadata">

**Author:** [@eterps](https://www.ruby-forum.com/u/eterps)\
**Replies:** 2\
**Last updated:** [June 6, 2008, 7:17pm UTC](https://www.ruby-forum.com/t/rspec-for-testing-rest-webservices-not-rails/196688 "2008-06-06T19:17:17Z")

</div>

Hi, I am new to RSpec and BDD. I was wondering if RSpec specifications are a good solution for testing REST webservices (not implemented in Rails). If so, what would be a good way to test something like the API descr…

---

## [Anyone seen weird autotest behaviour on trunk?](https://www.ruby-forum.com/t/anyone-seen-weird-autotest-behaviour-on-trunk/133440)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 13\
**Last updated:** [June 6, 2008, 3:14pm UTC](https://www.ruby-forum.com/t/anyone-seen-weird-autotest-behaviour-on-trunk/133440 "2008-06-06T15:14:22Z")

</div>

Hi I’m running RSpec and RSpec on Rails r3333, and autotest frequently - but not consistently - fails on my after I change an individual model code file file. The error I get is this: /usr/local/bin/ruby -S script…

---

## [Xhr :post giving wrong number of arguments on rails 2.1?](https://www.ruby-forum.com/t/xhr-post-giving-wrong-number-of-arguments-on-rails-2-1/139587)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 2\
**Last updated:** [June 6, 2008, 7:03am UTC](https://www.ruby-forum.com/t/xhr-post-giving-wrong-number-of-arguments-on-rails-2-1/139587 "2008-06-06T07:03:40Z")

</div>

Getting a strange error. In a story I have the following step: When “I submit a search name” do xhr :post, ‘/searches’, {:search =\> {:given\_name =\> “bob”, :family\_name =\> “smith”}} end I am getting: ArgumentError…

---

## [RSpec Story - SystemStackError: stack level too deep](https://www.ruby-forum.com/t/rspec-story-systemstackerror-stack-level-too-deep/139650)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 0\
**Last updated:** [June 5, 2008, 7:29pm UTC](https://www.ruby-forum.com/t/rspec-story-systemstackerror-stack-level-too-deep/139650 "2008-06-05T19:29:25Z")

</div>

I have a story that executes the following (as an example to show the bug I’m experiencing): Given “I have a fake post saved” do @postCount = Post.find(:all).length @post = Post.new @post.employee\_id = 123 @post.n…

---

## [Using and\_yield to pass multiple or no iterations](https://www.ruby-forum.com/t/using-and-yield-to-pass-multiple-or-no-iterations/139607)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 1\
**Last updated:** [June 5, 2008, 6:32pm UTC](https://www.ruby-forum.com/t/using-and-yield-to-pass-multiple-or-no-iterations/139607 "2008-06-05T18:32:24Z")

</div>

Hi, imagine there’s a class called Egg which has the following method (which calls another method): def do\_thing has\_iterated = false self.each\_row do |row| has\_iterated = true unless has\_iterated end has\_iterate…

---

## [Additional logging](https://www.ruby-forum.com/t/additional-logging/139613)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 0\
**Last updated:** [June 5, 2008, 2:49pm UTC](https://www.ruby-forum.com/t/additional-logging/139613 "2008-06-05T14:49:46Z")

</div>

Hi, I am using the ‘spec/story’ module with Fire(Watir). Is there additional logging? I don’t want to do this: Then "the resultant links are displayed with the search text in each description" do browser.links…

---

## [Any\_instance](https://www.ruby-forum.com/t/any-instance/139483)

<div class="topic-metadata">

**Author:** [@mattmcswain](https://www.ruby-forum.com/u/mattmcswain)\
**Replies:** 6\
**Last updated:** [June 5, 2008, 12:08pm UTC](https://www.ruby-forum.com/t/any-instance/139483 "2008-06-05T12:08:41Z")

</div>

Hi folks. I’m very interested in the status of a port of any\_instance from Mocha to RSpec. In particular I have a spec suite that I wrote using RSpec but with Mocha that depends heavily on any\_instance. This is becau…

---

## [Mock with an attributes that has state](https://www.ruby-forum.com/t/mock-with-an-attributes-that-has-state/139504)

<div class="topic-metadata">

**Author:** [@turnkeytraders](https://www.ruby-forum.com/u/turnkeytraders)\
**Replies:** 2\
**Last updated:** [June 4, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/mock-with-an-attributes-that-has-state/139504 "2008-06-04T19:31:54Z")

</div>

I’m developing a rails application. I have an Order model that has\_many OrderItems. I mocked the OrderItem model in my Order specs using mock\_model. I thought I should focus my specs on each model and always mock a…

---

## [Not running correct specs under autotest:](https://www.ruby-forum.com/t/not-running-correct-specs-under-autotest/139505)

<div class="topic-metadata">

**Author:** [@mattmcswain](https://www.ruby-forum.com/u/mattmcswain)\
**Replies:** 8\
**Last updated:** [June 4, 2008, 4:17pm UTC](https://www.ruby-forum.com/t/not-running-correct-specs-under-autotest/139505 "2008-06-04T16:17:14Z")

</div>

I know this isn’t autotest-users but I’m not sure where else to bring this up: \[\[“app/controllers/contents\_controller.rb”, Wed Jun 04 14:11:03 +0100 2008\]\] \[\[“app/controllers/contents\_controller.rb”, Wed Jun 04 14:11…

---

## [Controller filters running twice in 1.1.4?](https://www.ruby-forum.com/t/controller-filters-running-twice-in-1-1-4/139460)

<div class="topic-metadata">

**Author:** [@Matt\_McNeil](https://www.ruby-forum.com/u/Matt_McNeil)\
**Replies:** 5\
**Last updated:** [June 4, 2008, 10:27am UTC](https://www.ruby-forum.com/t/controller-filters-running-twice-in-1-1-4/139460 "2008-06-04T10:27:42Z")

</div>

since upgrading to 1.1.4 (I had been running without issue on a git snapshot), I’m noticing that my filter actions initiated from application.rb seem to be running twice. I created a test rails project with the rspec …

---

## [Autotest only passing spec files to rspec once](https://www.ruby-forum.com/t/autotest-only-passing-spec-files-to-rspec-once/134518)

<div class="topic-metadata">

**Author:** [@jorahood](https://www.ruby-forum.com/u/jorahood)\
**Replies:** 1\
**Last updated:** [June 4, 2008, 7:19am UTC](https://www.ruby-forum.com/t/autotest-only-passing-spec-files-to-rspec-once/134518 "2008-06-04T07:19:59Z")

</div>

When I run autotest it works fine the first time, generating the command line: /usr/bin/ruby1.8 -S script/spec -O spec/spec.opts spec/models/timespan\_spec.rb spec/models/article\_spec.rb … and all my specs get run. A…

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

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