# RSpec

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

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

---

## [Send\_file testing](https://www.ruby-forum.com/t/send-file-testing/161049)

<div class="topic-metadata">

**Author:** [@vo.x](https://www.ruby-forum.com/u/vo.x)\
**Replies:** 5\
**Last updated:** [February 24, 2009, 11:41pm UTC](https://www.ruby-forum.com/t/send-file-testing/161049 "2009-02-24T23:41:06Z")

</div>

Hello all, Is there some best practice how to test Rails controller action which is using send\_file method? Could you help me please? Vit

---

## [Setting Request Body (in stories in particular)](https://www.ruby-forum.com/t/setting-request-body-in-stories-in-particular/161116)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 1\
**Last updated:** [February 24, 2009, 10:59am UTC](https://www.ruby-forum.com/t/setting-request-body-in-stories-in-particular/161116 "2009-02-24T10:59:28Z")

</div>

I’m trying to set my request body in my tests (the application is a web service that takes large XML files in PUT requests). If you do this: put :update, :body =\> xml You get a request with an empty body, and a field…

---

## [Autotest won't pickup any tests](https://www.ruby-forum.com/t/autotest-wont-pickup-any-tests/160864)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 6\
**Last updated:** [February 24, 2009, 5:10am UTC](https://www.ruby-forum.com/t/autotest-wont-pickup-any-tests/160864 "2009-02-24T05:10:38Z")

</div>

Hey there, I’ve tried using Nick S.'s “plugin” to have autotest run my tests for gems and other non-rails stuff. However, it doesn’t seem to match any tests for any files. Not being sure what was wrong, I traced the …

---

## [A nice general purpose step definition for adding/finding activerecord records](https://www.ruby-forum.com/t/a-nice-general-purpose-step-definition-for-adding-finding-activerecord-records/161163)

<div class="topic-metadata">

**Author:** [@erik](https://www.ruby-forum.com/u/erik)\
**Replies:** 0\
**Last updated:** [February 24, 2009, 1:57am UTC](https://www.ruby-forum.com/t/a-nice-general-purpose-step-definition-for-adding-finding-activerecord-records/161163 "2009-02-24T01:57:27Z")

</div>

I thought other people might be interested in these step definitions. They allow you to write steps like: Given the following “turkeys” exist: |name |size |intelligence| |marko |big |dumb | |mello …

---

## [Rspec and autotest for standalone projects](https://www.ruby-forum.com/t/rspec-and-autotest-for-standalone-projects/196899)

<div class="topic-metadata">

**Author:** [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Replies:** 0\
**Last updated:** [February 23, 2009, 5:17pm UTC](https://www.ruby-forum.com/t/rspec-and-autotest-for-standalone-projects/196899 "2009-02-23T17:17:27Z")

</div>

Hey there, I’ve tried using Nick S.'s “plugin” to have autotest run my tests for gems and other non-rails stuff. However, it doesn’t seem to match any tests for any files. Not being sure what was wrong, I traced the …

---

## [New Google Groups for Vim and Ruby/Rails Developers](https://www.ruby-forum.com/t/new-google-groups-for-vim-and-ruby-rails-developers/160633)

<div class="topic-metadata">

**Author:** [@Hunt\_J](https://www.ruby-forum.com/u/Hunt_J)\
**Replies:** 1\
**Last updated:** [February 23, 2009, 5:07pm UTC](https://www.ruby-forum.com/t/new-google-groups-for-vim-and-ruby-rails-developers/160633 "2009-02-23T17:07:57Z")

</div>

Announcement for new group for Vim users. http://groups.google.com/group/vim-on-rails?hl=en Sharing vim usage for Ruby on Rails development. Includes any platform (Windows, Linux and Mac). Discuss anything related to …

---

## [\[cucumber \]Missing lettersm 'a' mafter rake features](https://www.ruby-forum.com/t/cucumber-missing-lettersm-a-mafter-rake-features/161099)

<div class="topic-metadata">

**Author:** [@hoornet](https://www.ruby-forum.com/u/hoornet)\
**Replies:** 2\
**Last updated:** [February 23, 2009, 1:01pm UTC](https://www.ruby-forum.com/t/cucumber-missing-lettersm-a-mafter-rake-features/161099 "2009-02-23T13:01:03Z")

</div>

I am just starting with any testing really, but I chose this post as a tutorial. http://www.ultrasaurus.com/sarahblog/2008/12/rails-2-day-3-behavior-driven-development/comment-page-1/#comment-454 I have WinXP, so I ha…

---

## [Culerity Error while running feature](https://www.ruby-forum.com/t/culerity-error-while-running-feature/161016)

<div class="topic-metadata">

**Author:** [@kaleemullah](https://www.ruby-forum.com/u/kaleemullah)\
**Replies:** 4\
**Last updated:** [February 23, 2009, 5:22am UTC](https://www.ruby-forum.com/t/culerity-error-while-running-feature/161016 "2009-02-23T05:22:53Z")

</div>

Hi All, I need your guide on an issue. My Environment: Window xp , Rails 2.2.2, Rspec-rails 1.1.11, Rspec 1.1.11, Cucmber , Webrat,Culerity I installed the jruby, sets its path in environment. It shows me Version …

---

## [\[Cucumber\] host!](https://www.ruby-forum.com/t/cucumber-host/161005)

<div class="topic-metadata">

**Author:** [@marksbrain](https://www.ruby-forum.com/u/marksbrain)\
**Replies:** 3\
**Last updated:** [February 22, 2009, 10:47pm UTC](https://www.ruby-forum.com/t/cucumber-host/161005 "2009-02-22T22:47:09Z")

</div>

I’m trying to set a specific host that all my Cucumber steps should use. Putting ‘host! “beta.rupture.local”’ in Before in env.rb doesn’t produce any errors, but it doesn’t seem to be making the next request use that …

---

## [\[RSpec\]\[OT\] have autospec just run changed files](https://www.ruby-forum.com/t/rspec-ot-have-autospec-just-run-changed-files/160901)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 4\
**Last updated:** [February 22, 2009, 6:05pm UTC](https://www.ruby-forum.com/t/rspec-ot-have-autospec-just-run-changed-files/160901 "2009-02-22T18:05:47Z")

</div>

Hello all, Is there a way to have autospec and/or RSpactor just run the specs for the files that have changed and not run the entire spec suite afterwards? If you start autospec with -f it will wait for a change but …

---

## [Cucumber now runs Webrat and Celerity together](https://www.ruby-forum.com/t/cucumber-now-runs-webrat-and-celerity-together/161031)

<div class="topic-metadata">

**Author:** [@Joaquin\_Rivera\_P](https://www.ruby-forum.com/u/Joaquin_Rivera_P)\
**Replies:** 0\
**Last updated:** [February 22, 2009, 4:44pm UTC](https://www.ruby-forum.com/t/cucumber-now-runs-webrat-and-celerity-together/161031 "2009-02-22T16:44:27Z")

</div>

hey there, I have Cucumber running Webrat and Celerity (using culerity) together, check it out in the sample project: http://github.com/joahking/cukes/tree/masters It’s a first try, but it runs. I get them by follow…

---

## [\[Cucumber, Webrat\] Error backtraces shown as HTML in console](https://www.ruby-forum.com/t/cucumber-webrat-error-backtraces-shown-as-html-in-console/159521)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 3\
**Last updated:** [February 22, 2009, 4:34pm UTC](https://www.ruby-forum.com/t/cucumber-webrat-error-backtraces-shown-as-html-in-console/159521 "2009-02-22T16:34:37Z")

</div>

Since upgrading to Cucumber 0.1.99.19 I’ve noticed that the backtraces appearing in the console output are of the form: Page load was not successful (Code: 500): Followed by the dump of the rails error page. That pag…

---

## [\[OT\] Googled for 'cucumber page caching'](https://www.ruby-forum.com/t/ot-googled-for-cucumber-page-caching/160970)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 1\
**Last updated:** [February 21, 2009, 6:08pm UTC](https://www.ruby-forum.com/t/ot-googled-for-cucumber-page-caching/160970 "2009-02-21T18:08:46Z")

</div>

…and found this as 4th result: cheers, bartz

---

## [Specifying which button webrat should press](https://www.ruby-forum.com/t/specifying-which-button-webrat-should-press/153685)

<div class="topic-metadata">

**Author:** [@phylae](https://www.ruby-forum.com/u/phylae)\
**Replies:** 10\
**Last updated:** [February 20, 2009, 10:28pm UTC](https://www.ruby-forum.com/t/specifying-which-button-webrat-should-press/153685 "2009-02-20T22:28:34Z")

</div>

I was writing a feature in which I had webrat push a button. However, there are many buttons on this page with the same text. I wanted to specify which one would be push in as close a way I could to the way a person w…

---

## [\[~OT\] Celerity LinkedIn group](https://www.ruby-forum.com/t/ot-celerity-linkedin-group/160912)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 0\
**Last updated:** [February 20, 2009, 9:12pm UTC](https://www.ruby-forum.com/t/ot-celerity-linkedin-group/160912 "2009-02-20T21:12:48Z")

</div>

Hi all Marginally on-topic… as part of my compulsion to create LinkedIn groups, I made a group\[1\] for Celerity\[2\] today. Thought I would announce here, as there are quite possibly more Celerity users here than on th…

---

## [Mocking / stubbing errors for ActiveRecord](https://www.ruby-forum.com/t/mocking-stubbing-errors-for-activerecord/160808)

<div class="topic-metadata">

**Author:** [@html-kurs](https://www.ruby-forum.com/u/html-kurs)\
**Replies:** 12\
**Last updated:** [February 20, 2009, 7:27pm UTC](https://www.ruby-forum.com/t/mocking-stubbing-errors-for-activerecord/160808 "2009-02-20T19:27:13Z")

</div>

Hi, I’m trying to test my views using rspec. I want to test my edit- and new-view also for the case an error occurs (something like “title can’t be blank” and so on). Can someone point me please to an example where I…

---

## [\[ANN\] rspec-1.2 release candidate](https://www.ruby-forum.com/t/ann-rspec-1-2-release-candidate/160735)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 5\
**Last updated:** [February 20, 2009, 11:35am UTC](https://www.ruby-forum.com/t/ann-rspec-1-2-release-candidate/160735 "2009-02-20T11:35:07Z")

</div>

Hey fellow behaviour-drivers, rspec-1.2 and rspec-rails-1.2 are just about ready, but I’d like to get some feedback from the field before the release. Would the adventurous among you kindly grab the latest github gems…

---

## [Validate\_presence\_of](https://www.ruby-forum.com/t/validate-presence-of/160590)

<div class="topic-metadata">

**Author:** [@hayafirst](https://www.ruby-forum.com/u/hayafirst)\
**Replies:** 39\
**Last updated:** [February 19, 2009, 7:56pm UTC](https://www.ruby-forum.com/t/validate-presence-of/160590 "2009-02-19T19:56:40Z")

</div>

Hello, according to this post: http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released I should be able to write: describe User do it {should valdate\_presence\_of(:login)} end with rspec 1.1.12 But I got…

---

## [ActiveRecord::Base.should\_receive(:find) fails](https://www.ruby-forum.com/t/activerecord-base-should-receive-find-fails/160795)

<div class="topic-metadata">

**Author:** [@Tero\_T](https://www.ruby-forum.com/u/Tero_T)\
**Replies:** 1\
**Last updated:** [February 19, 2009, 7:54pm UTC](https://www.ruby-forum.com/t/activerecord-base-should-receive-find-fails/160795 "2009-02-19T19:54:53Z")

</div>

I’ve got an AR-model with some find-magic I want to test. When I have ActiveRecord::Base.should\_receive(:find).with(anything(),assert\_options) MyModel.find(:all,find\_options) in my example find-method somehow disappe…

---

## [\[Cucumber\] Level of features / Feature dependent steps](https://www.ruby-forum.com/t/cucumber-level-of-features-feature-dependent-steps/160576)

<div class="topic-metadata">

**Author:** [@lennylmiller](https://www.ruby-forum.com/u/lennylmiller)\
**Replies:** 5\
**Last updated:** [February 19, 2009, 5:49pm UTC](https://www.ruby-forum.com/t/cucumber-level-of-features-feature-dependent-steps/160576 "2009-02-19T17:49:23Z")

</div>

Forgive the long post, just looking for input/advice/alternate opinions… Like many I think that going through the exercise of framing user requests in Cucumber terms(Features, Scenarios…) really helps facilitate nece…

---

## [\[Cucumber\] Hi-res logo?](https://www.ruby-forum.com/t/cucumber-hi-res-logo/160743)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 1\
**Last updated:** [February 19, 2009, 9:33am UTC](https://www.ruby-forum.com/t/cucumber-hi-res-logo/160743 "2009-02-19T09:33:43Z")

</div>

I’m hoping that the designer (or the co-worker programmer) who won the Cucumber logo contest will see this message… I’m looking for a hi-res or vector-based version of the Cucumber logo for use in a presentation. If …

---

## [\[Cucumber\] Portuguese keywords not recognized](https://www.ruby-forum.com/t/cucumber-portuguese-keywords-not-recognized/160341)

<div class="topic-metadata">

**Author:** [@ol1barn3s](https://www.ruby-forum.com/u/ol1barn3s)\
**Replies:** 4\
**Last updated:** [February 18, 2009, 6:17pm UTC](https://www.ruby-forum.com/t/cucumber-portuguese-keywords-not-recognized/160341 "2009-02-18T18:17:48Z")

</div>

Hello, I’ve just installed cucumber 0.1.99, and it looks like the Portuguese step keywords aren’t recognized for some reason. I’m following this example up on github: http://github.com/aslakhellesoy/cucumber/blob/ae9…

---

## [\[RSpec\] #and\_raise](https://www.ruby-forum.com/t/rspec-and-raise/160480)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 2\
**Last updated:** [February 18, 2009, 4:46pm UTC](https://www.ruby-forum.com/t/rspec-and-raise/160480 "2009-02-18T16:46:57Z")

</div>

I often use #and\_raise like so: @error\_message = ‘Some error’ @sf.should\_receive(:shift\_time!).and\_raise @error\_message However, after trying to do this: @argument\_error = mock\_model ArgumentError, :message =\> @erro…

---

## [Cucumber hooks BeforeAll and AfterAll](https://www.ruby-forum.com/t/cucumber-hooks-beforeall-and-afterall/160389)

<div class="topic-metadata">

**Author:** [@Joaquin\_Rivera\_P](https://www.ruby-forum.com/u/Joaquin_Rivera_P)\
**Replies:** 7\
**Last updated:** [February 18, 2009, 8:04am UTC](https://www.ruby-forum.com/t/cucumber-hooks-beforeall-and-afterall/160389 "2009-02-18T08:04:38Z")

</div>

hey there, the short version: right now Cucumber provides hooks Before and After to be run around every step, I have notice some use case where BeforeAll and AfterAll hooks would be useful. are ther plans that the…

---

## [What rescue hooks](https://www.ruby-forum.com/t/what-rescue-hooks/160303)

<div class="topic-metadata">

**Author:** [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Replies:** 1\
**Last updated:** [February 18, 2009, 12:12am UTC](https://www.ruby-forum.com/t/what-rescue-hooks/160303 "2009-02-18T00:12:19Z")

</div>

A few of our tests attempt to test controllers with production-style rescuing. Before the current rspec/Rails 2.2.2 combo, it was fairly easy to set up for these tests: it “should throw a 404 for strange actions” do …

---

## [\[Cucumber\] ssl requirement](https://www.ruby-forum.com/t/cucumber-ssl-requirement/160264)

<div class="topic-metadata">

**Author:** [@Wincent\_C](https://www.ruby-forum.com/u/Wincent_C)\
**Replies:** 6\
**Last updated:** [February 17, 2009, 3:14pm UTC](https://www.ruby-forum.com/t/cucumber-ssl-requirement/160264 "2009-02-17T15:14:52Z")

</div>

I’m trying to write features for an SSL-only site, but I can’t test anything because every request in my stories results in a redirect (the site is set up to redirect non-SSL requests to SSL). In my specs I hack aroun…

---

## [Rspec approach to test model](https://www.ruby-forum.com/t/rspec-approach-to-test-model/160074)

<div class="topic-metadata">

**Author:** [@kaleemullah](https://www.ruby-forum.com/u/kaleemullah)\
**Replies:** 30\
**Last updated:** [February 17, 2009, 1:59pm UTC](https://www.ruby-forum.com/t/rspec-approach-to-test-model/160074 "2009-02-17T13:59:56Z")

</div>

Hi, I am quite new to Rspec. I want to use Rspec to test my existing Code. I start from Models (Unit Testing). Here i want your help on a issue. Here is model/user\_spec.rb describe User do before(:each) do @user=U…

---

## [\[Cucumber, rspec-rails\] uninitialized constant ActionController::UrlEncodedPairParser](https://www.ruby-forum.com/t/cucumber-rspec-rails-uninitialized-constant-actioncontroller-urlencodedpairparser/160489)

<div class="topic-metadata">

**Author:** [@cwd](https://www.ruby-forum.com/u/cwd)\
**Replies:** 5\
**Last updated:** [February 17, 2009, 12:32am UTC](https://www.ruby-forum.com/t/cucumber-rspec-rails-uninitialized-constant-actioncontroller-urlencodedpairparser/160489 "2009-02-17T00:32:11Z")

</div>

It seems there’s a known anomaly between rspec-rails and Rails 2.3. That causes the error “uninitialized constant ActionController::UrlEncodedPairParser”. I know there is a fix in somebody’s repo, but what’s the best …

---

## [\[Cucumber\] 0 scenarios running "dirty" features in Autotest](https://www.ruby-forum.com/t/cucumber-0-scenarios-running-dirty-features-in-autotest/160488)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 0\
**Last updated:** [February 16, 2009, 11:07pm UTC](https://www.ruby-forum.com/t/cucumber-0-scenarios-running-dirty-features-in-autotest/160488 "2009-02-16T23:07:04Z")

</div>

When running autotest with AUTOFEATURE=true, all of my specs and features run fine. However, if I have a feature containing a scenario that fails, autotest lists that feature, but then returns “0 scenarios”, and then …

---

## [\[cucumber\] can't use 'visit' except with \`rake features\`](https://www.ruby-forum.com/t/cucumber-cant-use-visit-except-with-rake-features/160405)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [February 16, 2009, 7:30am UTC](https://www.ruby-forum.com/t/cucumber-cant-use-visit-except-with-rake-features/160405 "2009-02-16T07:30:18Z")

</div>

I ported some stories from restful\_authentication so that they can use cucumber, and it worked fine in rake features. Now when I try to run under autospec or cucumber features, I’m getting failures with undefined meth…

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

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