# RSpec

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

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

---

## [Webrat and submitting a form using an image](https://www.ruby-forum.com/t/webrat-and-submitting-a-form-using-an-image/150146)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 2\
**Last updated:** [October 5, 2008, 4:55pm UTC](https://www.ruby-forum.com/t/webrat-and-submitting-a-form-using-an-image/150146 "2008-10-05T16:55:07Z")

</div>

Webrat doesn’t seem to be able to handle the submit of a form through an image input. How do you handle that?

---

## [Best place to set load path for new spec folders](https://www.ruby-forum.com/t/best-place-to-set-load-path-for-new-spec-folders/150176)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 0\
**Last updated:** [October 5, 2008, 12:46pm UTC](https://www.ruby-forum.com/t/best-place-to-set-load-path-for-new-spec-folders/150176 "2008-10-05T12:46:52Z")

</div>

I have a bunch of observers in RAILS\_ROOT/spec/observers/ as well as in some sub directories for some name spaced observers. For example: \\spec \\observers person\_observer\_spec.rb \\admin user\_observer\_spec.rb auto…

---

## [Problem running cucumber](https://www.ruby-forum.com/t/problem-running-cucumber/150159)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 2\
**Last updated:** [October 5, 2008, 4:00am UTC](https://www.ruby-forum.com/t/problem-running-cucumber/150159 "2008-10-05T04:00:23Z")

</div>

When I run ‘rake features’, this is the output I get: /usr/local/bin/ruby -I “/home/joe/projects/voxy/vendor/plugins/cucumber/lib” “/home/joe/projects/voxy/vendor/plugins/cucumber/bin/cucumber” –format pretty --requi…

---

## [Newbie's question about generated features by cucumber in Rails](https://www.ruby-forum.com/t/newbies-question-about-generated-features-by-cucumber-in-rails/150149)

<div class="topic-metadata">

**Author:** [@Lian\_L](https://www.ruby-forum.com/u/Lian_L)\
**Replies:** 1\
**Last updated:** [October 4, 2008, 6:58pm UTC](https://www.ruby-forum.com/t/newbies-question-about-generated-features-by-cucumber-in-rails/150149 "2008-10-04T18:58:59Z")

</div>

Hi all, I am new to rspec and trying to use cucumber to learn writingfeatures. I follow the wiki page GitHub: Let’s build from here · GitHub to start my first feature. The command “ruby script/generate feature Froob…

---

## [Need to clear Mocha expectation?](https://www.ruby-forum.com/t/need-to-clear-mocha-expectation/150059)

<div class="topic-metadata">

**Author:** [@editkid](https://www.ruby-forum.com/u/editkid)\
**Replies:** 2\
**Last updated:** [October 3, 2008, 4:09pm UTC](https://www.ruby-forum.com/t/need-to-clear-mocha-expectation/150059 "2008-10-03T16:09:19Z")

</div>

Hi Folks, I have a problem that I have been able to isolate into a small test application. The problem seems to be that when I set an expectation on the number of times a method will be called in one describe block, …

---

## [How to catch a missing image (rspec-rails)](https://www.ruby-forum.com/t/how-to-catch-a-missing-image-rspec-rails/150071)

<div class="topic-metadata">

**Author:** [@idahoev](https://www.ruby-forum.com/u/idahoev)\
**Replies:** 1\
**Last updated:** [October 3, 2008, 7:37am UTC](https://www.ruby-forum.com/t/how-to-catch-a-missing-image-rspec-rails/150071 "2008-10-03T07:37:49Z")

</div>

I want to make sure all external resources called for by my views (like images) actually exist. How do I write an rspec that will fail when an image included on the page isn’t present? For example, let’s say in appli…

---

## [Slides from my talk on Cucumber + Celerity + RSpec tonight](https://www.ruby-forum.com/t/slides-from-my-talk-on-cucumber-celerity-rspec-tonight/150000)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 2\
**Last updated:** [October 2, 2008, 12:31pm UTC](https://www.ruby-forum.com/t/slides-from-my-talk-on-cucumber-celerity-rspec-tonight/150000 "2008-10-02T12:31:46Z")

</div>

Hi all Just ran a session known as a “huddle” in GeekUp terms. GeekUp\[1\] is a group of monthly events in North West England. The Sheffield one starts with a huddle every month, which is intended to have more audien…

---

## [How do BOTH these examples pass?](https://www.ruby-forum.com/t/how-do-both-these-examples-pass/149859)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 11\
**Last updated:** [October 2, 2008, 5:34am UTC](https://www.ruby-forum.com/t/how-do-both-these-examples-pass/149859 "2008-10-02T05:34:40Z")

</div>

Hi I’m, being thick, right?: describe RssReader do before(:each) do @uri = mock(URI) ::RSS::Parser.stub!(:parse).and\_return(:parsed\_rss) @rss\_reader = RssReader.new(@uri) end describe "when the RSS content loads"…

---

## [Associations should be private](https://www.ruby-forum.com/t/associations-should-be-private/149953)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 10\
**Last updated:** [October 2, 2008, 4:22am UTC](https://www.ruby-forum.com/t/associations-should-be-private/149953 "2008-10-02T04:22:10Z")

</div>

Hi The discussion among me, David, Michael, and Pat got me thinking. Specifically this by Michael: Just my $0.02, but I really like specs to be treated as specifications for what SHOULD be happening, not pretending …

---

## [Story runner has session limit of 4000 bytes, like CookieStore](https://www.ruby-forum.com/t/story-runner-has-session-limit-of-4000-bytes-like-cookiestore/149985)

<div class="topic-metadata">

**Author:** [@Yar\_Dmitriev](https://www.ruby-forum.com/u/Yar_Dmitriev)\
**Replies:** 0\
**Last updated:** [October 1, 2008, 11:59pm UTC](https://www.ruby-forum.com/t/story-runner-has-session-limit-of-4000-bytes-like-cookiestore/149985 "2008-10-01T23:59:30Z")

</div>

This could be intentional, but still surprising. Say, we are using ActiveRecord session store, according to the setting in environment.rb: config.action\_controller.session\_store = :active\_record\_store When controller…

---

## [Spec for 'an array should not include an item'](https://www.ruby-forum.com/t/spec-for-an-array-should-not-include-an-item/149876)

<div class="topic-metadata">

**Author:** [@chunkyslink](https://www.ruby-forum.com/u/chunkyslink)\
**Replies:** 12\
**Last updated:** [October 1, 2008, 11:14pm UTC](https://www.ruby-forum.com/t/spec-for-an-array-should-not-include-an-item/149876 "2008-10-01T23:14:23Z")

</div>

Does anyone know how I can write a spec along the lines of this (but a working implementation); it “should not include inactive users” do do\_get assigns\[:results\].should\_not include(users(:inactive\_user)) end I’m a…

---

## [Cucumber - stub! or mock?](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646)

<div class="topic-metadata">

**Author:** [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Replies:** 30\
**Last updated:** [October 1, 2008, 8:55pm UTC](https://www.ruby-forum.com/t/cucumber-stub-or-mock/148646 "2008-10-01T20:55:37Z")

</div>

Hey all, I’ve got some code that I (mostly) inherited. It essentially has a couple of AR class methods that look for a specific record by id: class Project \< ActiveRecord::Base class \<\< self def specific\_project @a…

---

## [\[ANN\] Cucumber Textmate Bundle](https://www.ruby-forum.com/t/ann-cucumber-textmate-bundle/148867)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 14\
**Last updated:** [October 1, 2008, 8:53pm UTC](https://www.ruby-forum.com/t/ann-cucumber-textmate-bundle/148867 "2008-10-01T20:53:16Z")

</div>

Hey all, I am in the process of porting my RSpec Story Textmate bundle over to Cucumber. So far I have the syntax highlighting, file switching, and running of the features and single scenarios done. So not all the f…

---

## [Shoulda](https://www.ruby-forum.com/t/shoulda/149841)

<div class="topic-metadata">

**Author:** [@awfreeman](https://www.ruby-forum.com/u/awfreeman)\
**Replies:** 13\
**Last updated:** [October 1, 2008, 10:05am UTC](https://www.ruby-forum.com/t/shoulda/149841 "2008-10-01T10:05:05Z")

</div>

I just stumbled upon this link this morning where Shoulda makes it easy to automatically load custom macros. Is there a similar feature in RSpec? http://technicalpickles.com/posts/shoulda-can-automatically-load-custo…

---

## [Why no rspec-rails gem?](https://www.ruby-forum.com/t/why-no-rspec-rails-gem/149668)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 6\
**Last updated:** [October 1, 2008, 6:29am UTC](https://www.ruby-forum.com/t/why-no-rspec-rails-gem/149668 "2008-10-01T06:29:15Z")

</div>

I was getting a little tired of adding 2 plugins every time I create a new rails project, so I just built an rspec-rails gemspec, and it works perfectly well. Does anybody know why there isn’t a public rspec-rails ge…

---

## [Using the response object in stories](https://www.ruby-forum.com/t/using-the-response-object-in-stories/149854)

<div class="topic-metadata">

**Author:** [@jmcervera](https://www.ruby-forum.com/u/jmcervera)\
**Replies:** 4\
**Last updated:** [September 30, 2008, 7:29pm UTC](https://www.ruby-forum.com/t/using-the-response-object-in-stories/149854 "2008-09-30T19:29:26Z")

</div>

I have this statement in the layout of my application (using haml) if request.env\[“HTTP\_USER\_AGENT”\].include?(“MSIE”) = stylesheet\_link\_tag ‘blueprint/ie.css’ = stylesheet\_link\_tag ‘confirm\_ie.css’ The problem is th…

---

## [Cucumber::ArityMismatchError](https://www.ruby-forum.com/t/cucumber-aritymismatcherror/149856)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 3\
**Last updated:** [September 30, 2008, 4:22pm UTC](https://www.ruby-forum.com/t/cucumber-aritymismatcherror/149856 "2008-09-30T16:22:55Z")

</div>

Hi, We are receiving an ArityMismatchError when we feel we have a valid RegEx error C:/svnprojects/olc\_stories/lib/framework/common\_steps/verification\_steps.rb:48:in /verify the email with the subject of '\[\\w\\x2E\\-\\…

---

## [ZenTest Autotest and 1.1.5](https://www.ruby-forum.com/t/zentest-autotest-and-1-1-5/149810)

<div class="topic-metadata">

**Author:** [@Donald\_F](https://www.ruby-forum.com/u/Donald_F)\
**Replies:** 5\
**Last updated:** [September 30, 2008, 3:15pm UTC](https://www.ruby-forum.com/t/zentest-autotest-and-1-1-5/149810 "2008-09-30T15:15:51Z")

</div>

I have been using ZenTest AutoTest with the previous version of rspec- rails. When I updated to 1.1.5 the autotest just hangs. Are these compatible? Don F.

---

## [Best way to determine if RSpec is loaded?](https://www.ruby-forum.com/t/best-way-to-determine-if-rspec-is-loaded/149725)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 2\
**Last updated:** [September 30, 2008, 3:10pm UTC](https://www.ruby-forum.com/t/best-way-to-determine-if-rspec-is-loaded/149725 "2008-09-30T15:10:34Z")

</div>

Hi I’ve been using the Twitter gem, but I discovered it loads ActiveSupport, which meddles with Kernel#require and generally causes me confusion and pain. I don’t need Twitter loaded for my specs, currently I’m doin…

---

## [Not seeing an RJS change](https://www.ruby-forum.com/t/not-seeing-an-rjs-change/149721)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 8\
**Last updated:** [September 30, 2008, 4:16am UTC](https://www.ruby-forum.com/t/not-seeing-an-rjs-change/149721 "2008-09-30T04:16:16Z")

</div>

I’m writing specs for an XHR, and am having troubles getting my specs to see that a is being hidden. === map\_filter.rjs 19 else 20 puts “map\_filter.rjs\> else!” 21 # Display the filter errors. 22 page\[‘map-filt…

---

## [Expect\_render](https://www.ruby-forum.com/t/expect-render/149790)

<div class="topic-metadata">

**Author:** [@sthorpe](https://www.ruby-forum.com/u/sthorpe)\
**Replies:** 6\
**Last updated:** [September 30, 2008, 3:09am UTC](https://www.ruby-forum.com/t/expect-render/149790 "2008-09-30T03:09:27Z")

</div>

I’m trying to write a spec asserting that no layout should be used in a controller. My spec currently looks like this: it "should render with no layout" do controller.expect\_render.with(hash\_including(:layout =\> n…

---

## [\[ANN\] RSpec-1.1.5 has been released](https://www.ruby-forum.com/t/ann-rspec-1-1-5-has-been-released/149729)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 3\
**Last updated:** [September 29, 2008, 4:06pm UTC](https://www.ruby-forum.com/t/ann-rspec-1-1-5-has-been-released/149729 "2008-09-29T16:06:10Z")

</div>

RSpec-1.1.5 has been released RSpec is a Behaviour Driven Development framework for Ruby. RSpec-1.1.5 has a ton of minor changes and bug fixes, and a few major ones. Please see the following for more information: ht…

---

## [Rake spec defaults to devel env](https://www.ruby-forum.com/t/rake-spec-defaults-to-devel-env/149616)

<div class="topic-metadata">

**Author:** [@Tero\_T](https://www.ruby-forum.com/u/Tero_T)\
**Replies:** 3\
**Last updated:** [September 29, 2008, 3:53pm UTC](https://www.ruby-forum.com/t/rake-spec-defaults-to-devel-env/149616 "2008-09-29T15:53:14Z")

</div>

I was experiencing the weirdest behavior (rake spec running fine without a test database) the other day. Turned out that actually rake spec was (and has been for heavens know how long for me) running in development en…

---

## [Lot's o' questions about Cucumbert](https://www.ruby-forum.com/t/lots-o-questions-about-cucumbert/149713)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 9\
**Last updated:** [September 29, 2008, 3:14pm UTC](https://www.ruby-forum.com/t/lots-o-questions-about-cucumbert/149713 "2008-09-29T15:14:08Z")

</div>

Is there somewhere a real documentation about using Cucumber + Webrat in a Rails project? For instance it seems that Cucumber doesn’t understand the word “Given” like Story Runner does.

---

## [Problems mocking controller helpers with the last version](https://www.ruby-forum.com/t/problems-mocking-controller-helpers-with-the-last-version/149750)

<div class="topic-metadata">

**Author:** [@jmcervera](https://www.ruby-forum.com/u/jmcervera)\
**Replies:** 4\
**Last updated:** [September 29, 2008, 1:55pm UTC](https://www.ruby-forum.com/t/problems-mocking-controller-helpers-with-the-last-version/149750 "2008-09-29T13:55:26Z")

</div>

I have just installed the edge version of rspec and rspec-rails and some of my specs related to views now fail. I use the helper current\_user in my views, to access the user that is actually logged in. I was simply u…

---

## [Rspec-ui overlap with cucumber?](https://www.ruby-forum.com/t/rspec-ui-overlap-with-cucumber/149747)

<div class="topic-metadata">

**Author:** [@Priit\_T](https://www.ruby-forum.com/u/Priit_T)\
**Replies:** 3\
**Last updated:** [September 29, 2008, 12:17pm UTC](https://www.ruby-forum.com/t/rspec-ui-overlap-with-cucumber/149747 "2008-09-29T12:17:22Z")

</div>

Hi! I’m using cucumber + selenium and I love it. However I’m looking to add some methods (example: click\_and\_wait etc) to the lib. Therefore looked around a bit and I got two questions: Firstly about rspec-ui, I’m a …

---

## [Webrat the way to go?](https://www.ruby-forum.com/t/webrat-the-way-to-go/148857)

<div class="topic-metadata">

**Author:** [@DyingToLearn](https://www.ruby-forum.com/u/DyingToLearn)\
**Replies:** 14\
**Last updated:** [September 29, 2008, 9:58am UTC](https://www.ruby-forum.com/t/webrat-the-way-to-go/148857 "2008-09-29T09:58:00Z")

</div>

Hi, Here is the short version of my question: For stories, is webrat the way to go? How many of you use webrat? How many don’t? Here is the long version: I have been writing specs for some time now. I have noticed …

---

## [Should change not comparing arrays how I expected](https://www.ruby-forum.com/t/should-change-not-comparing-arrays-how-i-expected/149705)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 12\
**Last updated:** [September 29, 2008, 2:56am UTC](https://www.ruby-forum.com/t/should-change-not-comparing-arrays-how-i-expected/149705 "2008-09-29T02:56:58Z")

</div>

Hi Just had a surprising result: it “should not appear in the Story.unposted list” do @story.save lambda { @story.post\_to\_twitter(@twitter\_client) }.should change { Story.unposted }.from(\[@story\]).to(\[\]) end ‘Sto…

---

## [Stubbing renders](https://www.ruby-forum.com/t/stubbing-renders/149716)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 1\
**Last updated:** [September 28, 2008, 10:46pm UTC](https://www.ruby-forum.com/t/stubbing-renders/149716 "2008-09-28T22:46:21Z")

</div>

Hi guys. I’m curious to know why this method of stubbing a render fails: ActionController::Base.stub!(:render\_to\_string).and\_return ‘something’ And why this is \[one of\] the correct methods: controller.stub\_render :par…

---

## [Running RSpec from within my Ruby application](https://www.ruby-forum.com/t/running-rspec-from-within-my-ruby-application/149656)

<div class="topic-metadata">

**Author:** [@liberte](https://www.ruby-forum.com/u/liberte)\
**Replies:** 3\
**Last updated:** [September 28, 2008, 11:22am UTC](https://www.ruby-forum.com/t/running-rspec-from-within-my-ruby-application/149656 "2008-09-28T11:22:53Z")

</div>

Hi all (I tried to send this question to the list a few hours ago, but it seems to have not got through. If it did sorry for the duplication.) Does anyone have any tips or examples of how to run RSpec example groups …

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

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