# RSpec

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

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

---

## [Html::document errors](https://www.ruby-forum.com/t/html-document-errors/170885)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 2\
**Last updated:** [June 26, 2009, 4:02pm UTC](https://www.ruby-forum.com/t/html-document-errors/170885 "2009-06-26T16:02:02Z")

</div>

And Joe should see a radio button representing the answer ‘OJ’ features/step\_definitions/trat\_steps.rb:111 uninitialized constant HTML::Document (NameError) /home/joe/projects/cisv/vendor/plugins/rspec/lib/spec/matc…

---

## [When spec/test/unit is used then TestUnit Console Runner.run TestCase does not run testcases](https://www.ruby-forum.com/t/when-spec-test-unit-is-used-then-testunit-console-runner-run-testcase-does-not-run-testcases/171058)

<div class="topic-metadata">

**Author:** [@marekj](https://www.ruby-forum.com/u/marekj)\
**Replies:** 3\
**Last updated:** [June 25, 2009, 10:38pm UTC](https://www.ruby-forum.com/t/when-spec-test-unit-is-used-then-testunit-console-runner-run-testcase-does-not-run-testcases/171058 "2009-06-25T22:38:01Z")

</div>

Hi, I have some old test/unit testcases (used for browser acceptance tests) that I want to convert to rspec. I first started converting assertions to matchers and my tests ran fine using TestRunner.run method Here …

---

## [Running RSpec under MultiRuby](https://www.ruby-forum.com/t/running-rspec-under-multiruby/170995)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 4\
**Last updated:** [June 25, 2009, 6:15pm UTC](https://www.ruby-forum.com/t/running-rspec-under-multiruby/170995 "2009-06-25T18:15:35Z")

</div>

I just published a quick article showing how to use the patch I provided and David just release in RSpec 1.2.7 to run your specs using multiruby: http://talklikeaduck.denhaven2.com/2009/06/24/rspec-meet-multiruby – …

---

## [Any idea why spec\_server gets 'cannot remove Object' error?](https://www.ruby-forum.com/t/any-idea-why-spec-server-gets-cannot-remove-object-error/170839)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 5\
**Last updated:** [June 25, 2009, 1:16am UTC](https://www.ruby-forum.com/t/any-idea-why-spec-server-gets-cannot-remove-object-error/170839 "2009-06-25T01:16:43Z")

</div>

I am sure better minds than mine can figure this out, but I am stumped. When I run any spec using spec\_server, a get 0 failures and the command prompt returns without issue. If I run the same spec again, I still get 0…

---

## [Undefined method \`blueprint' with rspec/machinist/faker](https://www.ruby-forum.com/t/undefined-method-blueprint-with-rspec-machinist-faker/170918)

<div class="topic-metadata">

**Author:** [@Yoann-Z](https://www.ruby-forum.com/u/Yoann-Z)\
**Replies:** 2\
**Last updated:** [June 24, 2009, 7:41pm UTC](https://www.ruby-forum.com/t/undefined-method-blueprint-with-rspec-machinist-faker/170918 "2009-06-24T19:41:49Z")

</div>

Hi, I just started using Machinist for my project. So I successfully installed notahat-machinist and faker gems and as soon as I run a spec I get the following error : /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/l…

---

## [Spec\_server is dead! Long live spork!](https://www.ruby-forum.com/t/spec-server-is-dead-long-live-spork/170894)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 1\
**Last updated:** [June 24, 2009, 3:55am UTC](https://www.ruby-forum.com/t/spec-server-is-dead-long-live-spork/170894 "2009-06-24T03:55:39Z")

</div>

Hey all, Just a heads up that the rspec-rails-1.2.7.1 release deprecates spec\_server in favor of Tim H.'s spork gem. http://github.com/timcharper/spork I’ve already removed spec\_server from the rspec-rails git repo, …

---

## [Spec'ing the result of rescue\_from](https://www.ruby-forum.com/t/specing-the-result-of-rescue-from/170801)

<div class="topic-metadata">

**Author:** [@PJ\_Kelly](https://www.ruby-forum.com/u/PJ_Kelly)\
**Replies:** 3\
**Last updated:** [June 23, 2009, 8:41pm UTC](https://www.ruby-forum.com/t/specing-the-result-of-rescue-from/170801 "2009-06-23T20:41:59Z")

</div>

Hey All, In my app, I have actions that are restricted to only POST requests in config/routes.rb. We were getting a fair number of MethodNotAllowed errors on these actions. In most cases, we’re ok with sending the …

---

## [Asynchronous requests (effectively in multiple browser windows)](https://www.ruby-forum.com/t/asynchronous-requests-effectively-in-multiple-browser-windows/170866)

<div class="topic-metadata">

**Author:** [@dhstudio](https://www.ruby-forum.com/u/dhstudio)\
**Replies:** 1\
**Last updated:** [June 23, 2009, 7:40pm UTC](https://www.ruby-forum.com/t/asynchronous-requests-effectively-in-multiple-browser-windows/170866 "2009-06-23T19:40:17Z")

</div>

Hi. I’m using cucumber on a rails app along with rspec & webrat. Is there any way in cucumber to write scenarios that would use more than one window in an equivalent manual test? I am wanting to write a feature scen…

---

## [\[Cucumber\]\[Webrat\] Using LinkLocator in cucumber step definitions](https://www.ruby-forum.com/t/cucumber-webrat-using-linklocator-in-cucumber-step-definitions/170861)

<div class="topic-metadata">

**Author:** [@dhstudio](https://www.ruby-forum.com/u/dhstudio)\
**Replies:** 1\
**Last updated:** [June 23, 2009, 6:08pm UTC](https://www.ruby-forum.com/t/cucumber-webrat-using-linklocator-in-cucumber-step-definitions/170861 "2009-06-23T18:08:42Z")

</div>

I am wanting to specify “Then I should not see a “New item” link” in a cucumber scenario. Is it possible to use Webrat::Locators.find\_link (as used in click\_link) in a cucumber step definition? Or is there some reason …

---

## [\[ANN\] rspec-rails 1.2.7 Released](https://www.ruby-forum.com/t/ann-rspec-rails-1-2-7-released/170811)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 1\
**Last updated:** [June 23, 2009, 7:17am UTC](https://www.ruby-forum.com/t/ann-rspec-rails-1-2-7-released/170811 "2009-06-23T07:17:31Z")

</div>

rspec-rails-1.2.7 has been released! Behaviour Driven Development for Ruby on Rails. Changes: Version 1.2.7 / 2009-06-22 enhancements alias :stub!, :stub so rspec-rails extensions of rspec stubs can use the sam…

---

## [Testing a FormBuilder](https://www.ruby-forum.com/t/testing-a-formbuilder/170784)

<div class="topic-metadata">

**Author:** [@pallan](https://www.ruby-forum.com/u/pallan)\
**Replies:** 6\
**Last updated:** [June 22, 2009, 11:00pm UTC](https://www.ruby-forum.com/t/testing-a-formbuilder/170784 "2009-06-22T23:00:49Z")

</div>

Hello all, In a bit of a conundrum here. I have a custom form builder I am trying to test and can’t seem to get it to work. I found this http://www.pathf.com/blogs/2007/12/rspec-and-rails/ which helps in that it …

---

## [Where to put macros](https://www.ruby-forum.com/t/where-to-put-macros/170777)

<div class="topic-metadata">

**Author:** [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Replies:** 5\
**Last updated:** [June 22, 2009, 7:57pm UTC](https://www.ruby-forum.com/t/where-to-put-macros/170777 "2009-06-22T19:57:36Z")

</div>

Recently I got some wonderful help from the list to create my NamedAddress module/macro which tests NamedAddresses for a number of different resources. The question I have is where should I put this module? At the mo…

---

## [\[Cucumber\] Autospec run "only" features?](https://www.ruby-forum.com/t/cucumber-autospec-run-only-features/170771)

<div class="topic-metadata">

**Author:** [@churp](https://www.ruby-forum.com/u/churp)\
**Replies:** 1\
**Last updated:** [June 22, 2009, 5:54pm UTC](https://www.ruby-forum.com/t/cucumber-autospec-run-only-features/170771 "2009-06-22T17:54:46Z")

</div>

Hello All, Is there a way to Autospec “only” my features? I know this is an anti-pattern. Just trying to auto-cycle while figuring out some things with Cucumber. Once I get the Cuke code ironed out, I’d happily ret…

---

## [\[Cucumber\] Successive requests with xml Content-Type fail?](https://www.ruby-forum.com/t/cucumber-successive-requests-with-xml-content-type-fail/170735)

<div class="topic-metadata">

**Author:** [@wolframarnold](https://www.ruby-forum.com/u/wolframarnold)\
**Replies:** 1\
**Last updated:** [June 22, 2009, 10:24am UTC](https://www.ruby-forum.com/t/cucumber-successive-requests-with-xml-content-type-fail/170735 "2009-06-22T10:24:27Z")

</div>

I’m writing a cucumber test for an xml webservice. When making POST’s the Content-Type in the header is set to “application/xml” and for any request, the Accept header is set to “application/xml” (aka Mime::XML.to\_s) …

---

## [Testing my rails authentication controller](https://www.ruby-forum.com/t/testing-my-rails-authentication-controller/169622)

<div class="topic-metadata">

**Author:** [@wayne\_a](https://www.ruby-forum.com/u/wayne_a)\
**Replies:** 2\
**Last updated:** [June 19, 2009, 8:32pm UTC](https://www.ruby-forum.com/t/testing-my-rails-authentication-controller/169622 "2009-06-19T20:32:40Z")

</div>

I have a simple controller: class AccessController \< ApplicationController def login if request.post? employee = Employee.authenticate(params\[:name\], params\[:password\]) if employee session\[:employee\_id\] = e…

---

## [Re: spec for view with Searchlogic](https://www.ruby-forum.com/t/re-spec-for-view-with-searchlogic/170609)

<div class="topic-metadata">

**Author:** [@codinggurl](https://www.ruby-forum.com/u/codinggurl)\
**Replies:** 0\
**Last updated:** [June 19, 2009, 5:03pm UTC](https://www.ruby-forum.com/t/re-spec-for-view-with-searchlogic/170609 "2009-06-19T17:03:05Z")

</div>

Hi, for using rspec with the SearchLogic plugin we found the following solutions to mock/stub the necessary objects/methods: Views: create search logic values @search = mock(“search”) @search.stub!(:page\_count).an…

---

## [Re: spec for view with Searchlogic](https://www.ruby-forum.com/t/re-spec-for-view-with-searchlogic/170607)

<div class="topic-metadata">

**Author:** [@codinggurl](https://www.ruby-forum.com/u/codinggurl)\
**Replies:** 0\
**Last updated:** [June 19, 2009, 5:03pm UTC](https://www.ruby-forum.com/t/re-spec-for-view-with-searchlogic/170607 "2009-06-19T17:03:04Z")

</div>

Hi, for using rspec with the SearchLogic plugin we found the following solutions to mock/stub the necessary objects/methods: Views: create search logic values @search = mock(“search”) @search.stub!(:page\_count).an…

---

## [Can't use Cucumber with Webrat and Selenium](https://www.ruby-forum.com/t/cant-use-cucumber-with-webrat-and-selenium/164767)

<div class="topic-metadata">

**Author:** [@enno](https://www.ruby-forum.com/u/enno)\
**Replies:** 6\
**Last updated:** [June 19, 2009, 4:50pm UTC](https://www.ruby-forum.com/t/cant-use-cucumber-with-webrat-and-selenium/164767 "2009-06-19T16:50:34Z")

</div>

Hi, I followed the instructions at http://wiki.github.com/aslakhellesoy/cucumber/setting-up-selenium to get Selenium and Webrat to work with Cucumber. I have no problems using Webrat but when I switch to use Selenium…

---

## [Spork and Merb and rSpec](https://www.ruby-forum.com/t/spork-and-merb-and-rspec/170282)

<div class="topic-metadata">

**Author:** [@Andy\_Shipman](https://www.ruby-forum.com/u/Andy_Shipman)\
**Replies:** 7\
**Last updated:** [June 18, 2009, 11:44pm UTC](https://www.ruby-forum.com/t/spork-and-merb-and-rspec/170282 "2009-06-18T23:44:55Z")

</div>

When running spork on a merb application, whenever a spec is run I get the following error from the Spork server. /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0.11/lib/merb-core/ bootloader.rb:1358: \[BUG\] rb\_gc\_mark(…

---

## [The problem with learning RSpec](https://www.ruby-forum.com/t/the-problem-with-learning-rspec/170538)

<div class="topic-metadata">

**Author:** [@sackerson](https://www.ruby-forum.com/u/sackerson)\
**Replies:** 3\
**Last updated:** [June 18, 2009, 8:12pm UTC](https://www.ruby-forum.com/t/the-problem-with-learning-rspec/170538 "2009-06-18T20:12:30Z")

</div>

I read this whole thread with interest (alerted by a cross-post on the railsbridge list, thx Zach). Thanks Stephen for kicking off this interesting discussion: sample rails app that makes good use of RSpec and Cucum…

---

## [Shared examples sharing methods](https://www.ruby-forum.com/t/shared-examples-sharing-methods/170440)

<div class="topic-metadata">

**Author:** [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Replies:** 9\
**Last updated:** [June 18, 2009, 7:07am UTC](https://www.ruby-forum.com/t/shared-examples-sharing-methods/170440 "2009-06-18T07:07:53Z")

</div>

Please have a look at What I’d like to do is create a shared\_examples group which I can parametize a method. So my shared example would perhaps use method named\_address=, or set\_named\_address and then groups that …

---

## [Problem verifying routing error](https://www.ruby-forum.com/t/problem-verifying-routing-error/167057)

<div class="topic-metadata">

**Author:** [@randy\_hendriawan](https://www.ruby-forum.com/u/randy_hendriawan)\
**Replies:** 10\
**Last updated:** [June 18, 2009, 5:40am UTC](https://www.ruby-forum.com/t/problem-verifying-routing-error/167057 "2009-06-18T05:40:13Z")

</div>

Hi, When upgrading to rspec/rspec-rails 1.2.6 gem (from 1.1.12), I’m having a new problem verifying routes that should not exist. This is to support something like this in routes.rb: map.resources :orders do |orders| …

---

## [Removing Mocha; 'spec spec' fails but the specific model file passes](https://www.ruby-forum.com/t/removing-mocha-spec-spec-fails-but-the-specific-model-file-passes/170209)

<div class="topic-metadata">

**Author:** [@doug](https://www.ruby-forum.com/u/doug)\
**Replies:** 2\
**Last updated:** [June 17, 2009, 9:31pm UTC](https://www.ruby-forum.com/t/removing-mocha-spec-spec-fails-but-the-specific-model-file-passes/170209 "2009-06-17T21:31:25Z")

</div>

I happened to mix ryan bates’ authentication scaffold with rspec\_scaffold on a demo project. and ran into the problem of mixing mock frameworks…ryan uses mocha. So, as a learning experience, I choose to redo ryan’s t…

---

## [Spec for image upload and resizing](https://www.ruby-forum.com/t/spec-for-image-upload-and-resizing/170266)

<div class="topic-metadata">

**Author:** [@srinu](https://www.ruby-forum.com/u/srinu)\
**Replies:** 2\
**Last updated:** [June 16, 2009, 6:51am UTC](https://www.ruby-forum.com/t/spec-for-image-upload-and-resizing/170266 "2009-06-16T06:51:12Z")

</div>

Hi, I have a written spec for image upload model using paperclip plug- in. The sample code looks like Testing the upload image just not validation and saving to database, its about the input image has got cropped o…

---

## [Autospec Infinite Loop?](https://www.ruby-forum.com/t/autospec-infinite-loop/164886)

<div class="topic-metadata">

**Author:** [@arco](https://www.ruby-forum.com/u/arco)\
**Replies:** 15\
**Last updated:** [June 15, 2009, 4:21pm UTC](https://www.ruby-forum.com/t/autospec-infinite-loop/164886 "2009-06-15T16:21:28Z")

</div>

When I run autospec and I have a red example, autospec goes into an infinite loop and runs over and over until I get rid of the red. I hate this. I want my tests to just run once when my ruby file is saved - even if …

---

## [Problem while generating rspec model in Rails Project](https://www.ruby-forum.com/t/problem-while-generating-rspec-model-in-rails-project/170108)

<div class="topic-metadata">

**Author:** [@ninad](https://www.ruby-forum.com/u/ninad)\
**Replies:** 6\
**Last updated:** [June 15, 2009, 3:32pm UTC](https://www.ruby-forum.com/t/problem-while-generating-rspec-model-in-rails-project/170108 "2009-06-15T15:32:07Z")

</div>

Hi, I am new to testing and Rspec. I have one rails project created on my machine. In this project under \\app\\models i have a file called “client.rb” which has been already created. Now i want to generate spec file f…

---

## [Can I set params in before\[:each\] block?](https://www.ruby-forum.com/t/can-i-set-params-in-before-each-block/170098)

<div class="topic-metadata">

**Author:** [@lee](https://www.ruby-forum.com/u/lee)\
**Replies:** 3\
**Last updated:** [June 13, 2009, 6:03pm UTC](https://www.ruby-forum.com/t/can-i-set-params-in-before-each-block/170098 "2009-06-13T18:03:05Z")

</div>

In my controller’s create method, I have: @sub\_context = @context.create\_sub\_context(params\[:context\]\[:name\]) If I do not specify params in the “post :create” call in my controller spec then I get the following error …

---

## [I am having a problem testing a date in a rails view](https://www.ruby-forum.com/t/i-am-having-a-problem-testing-a-date-in-a-rails-view/170087)

<div class="topic-metadata">

**Author:** [@powertoaster](https://www.ruby-forum.com/u/powertoaster)\
**Replies:** 3\
**Last updated:** [June 12, 2009, 7:06pm UTC](https://www.ruby-forum.com/t/i-am-having-a-problem-testing-a-date-in-a-rails-view/170087 "2009-06-12T19:06:47Z")

</div>

I see June 13, 2009 on my index page when running in development. I get this 2. is not true. require File.expand\_path(File.dirname(FILE) + ‘/…/…/spec\_helper’) describe “/timesheets/index.html.erb” do include Times…

---

## [Mock and Stub objects](https://www.ruby-forum.com/t/mock-and-stub-objects/169934)

<div class="topic-metadata">

**Author:** [@tornado](https://www.ruby-forum.com/u/tornado)\
**Replies:** 11\
**Last updated:** [June 12, 2009, 4:46pm UTC](https://www.ruby-forum.com/t/mock-and-stub-objects/169934 "2009-06-12T16:46:21Z")

</div>

Hello, I had seen many controller spec using mock and stub objects. I had written controller spec earlier without these objects. In the book it is mention about mock and stub objects.but i am still not getting …

---

## [Fixtures are not loaded while running controller spec](https://www.ruby-forum.com/t/fixtures-are-not-loaded-while-running-controller-spec/170053)

<div class="topic-metadata">

**Author:** [@tornado](https://www.ruby-forum.com/u/tornado)\
**Replies:** 4\
**Last updated:** [June 12, 2009, 8:33am UTC](https://www.ruby-forum.com/t/fixtures-are-not-loaded-while-running-controller-spec/170053 "2009-06-12T08:33:58Z")

</div>

Hi, I am running controller spec and it gives me result as 0 examples, 0 failures. I checked into the database and i saw that fixtures are not loaded. Following are the details of my controller file. require File.ex…

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

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