# RSpec

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

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

---

## [RecordNotFound bubbling thru to cucumber](https://www.ruby-forum.com/t/recordnotfound-bubbling-thru-to-cucumber/159656)

<div class="topic-metadata">

**Author:** [@reversejt](https://www.ruby-forum.com/u/reversejt)\
**Replies:** 6\
**Last updated:** [February 9, 2009, 4:43pm UTC](https://www.ruby-forum.com/t/recordnotfound-bubbling-thru-to-cucumber/159656 "2009-02-09T16:43:40Z")

</div>

Hello, I have a controller action that raises a RecordNotFound exception if you’re not allowed to see something. In my global application controller (application.rb), I catch these and render the 404 template. But wh…

---

## [Step definitons to check login](https://www.ruby-forum.com/t/step-definitons-to-check-login/155787)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 20\
**Last updated:** [February 9, 2009, 4:05pm UTC](https://www.ruby-forum.com/t/step-definitons-to-check-login/155787 "2009-02-09T16:05:56Z")

</div>

I am working with the authlogic gem and trying to create a simple login test from cucumber features. The feature statement is: Given the user is not logged in The step definition for this is confounding me. In the a…

---

## [Fixjour and others](https://www.ruby-forum.com/t/fixjour-and-others/159614)

<div class="topic-metadata">

**Author:** [@jmcervera](https://www.ruby-forum.com/u/jmcervera)\
**Replies:** 7\
**Last updated:** [February 9, 2009, 12:55am UTC](https://www.ruby-forum.com/t/fixjour-and-others/159614 "2009-02-09T00:55:41Z")

</div>

Hello I have seen that some people in this list is using Fixjour as the replacement of fixtures. But I can’t understand why it is superior or better than other approaches to the subject like Machinist o FactoryGirl. …

---

## [\[OT\] RSpec on MSDN](https://www.ruby-forum.com/t/ot-rspec-on-msdn/159804)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 0\
**Last updated:** [February 9, 2009, 12:54am UTC](https://www.ruby-forum.com/t/ot-rspec-on-msdn/159804 "2009-02-09T00:54:30Z")

</div>

Just saw this twitter by and thought people might be interested: Matt W. http://blog.mattwynne.net

---

## [How to return a value passed by ref to a method](https://www.ruby-forum.com/t/how-to-return-a-value-passed-by-ref-to-a-method/159765)

<div class="topic-metadata">

**Author:** [@rgagnon](https://www.ruby-forum.com/u/rgagnon)\
**Replies:** 3\
**Last updated:** [February 8, 2009, 11:43pm UTC](https://www.ruby-forum.com/t/how-to-return-a-value-passed-by-ref-to-a-method/159765 "2009-02-08T23:43:41Z")

</div>

Hi, I have a recursive method and I want to mock a var passed by ref. Object.should\_receive(:my\_method).and\_return"by\_ref"(@value) Something like that. Any idea? RÃ©mi

---

## [\[RSpec\] Setting a gem dep on rspec-rails](https://www.ruby-forum.com/t/rspec-setting-a-gem-dep-on-rspec-rails/159731)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 6\
**Last updated:** [February 8, 2009, 11:42pm UTC](https://www.ruby-forum.com/t/rspec-setting-a-gem-dep-on-rspec-rails/159731 "2009-02-08T23:42:30Z")

</div>

For a while now, I’ve had the following in config/environment.rb : config.gem ‘haml’ config.gem ‘rspec’, :lib =\> ‘spec’ config.gem ‘rspec-rails’, :lib =\> ‘spec/rails’ I just tried running the Rails console in product…

---

## [\[OT\] Jay Fields' blog on developer testing](https://www.ruby-forum.com/t/ot-jay-fields-blog-on-developer-testing/159502)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 25\
**Last updated:** [February 8, 2009, 9:24pm UTC](https://www.ruby-forum.com/t/ot-jay-fields-blog-on-developer-testing/159502 "2009-02-08T21:24:35Z")

</div>

I highly recommend this blog post by Jay Fields: Cheers, David

---

## [Speccing the format portion of a controller](https://www.ruby-forum.com/t/speccing-the-format-portion-of-a-controller/159706)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 7\
**Last updated:** [February 8, 2009, 6:01pm UTC](https://www.ruby-forum.com/t/speccing-the-format-portion-of-a-controller/159706 "2009-02-08T18:01:34Z")

</div>

Hi – I have a hacky work-around for this, but wondered if anyone could tell me the canonical way of sending the get/put/etc. portion of a spec with format information.I guess with something that might look like this: …

---

## [How to spec within a block?](https://www.ruby-forum.com/t/how-to-spec-within-a-block/159764)

<div class="topic-metadata">

**Author:** [@rgagnon](https://www.ruby-forum.com/u/rgagnon)\
**Replies:** 2\
**Last updated:** [February 8, 2009, 5:08pm UTC](https://www.ruby-forum.com/t/how-to-spec-within-a-block/159764 "2009-02-08T17:08:37Z")

</div>

I want to mock to Model.to\_xml but not his block. How to do it? Here is what I have (sorry for the formatting) output = @detenteur.to\_xml( :skip\_types =\> false, :skip\_instruct =\> true, :dasherize =\> false, :only =\> …

---

## [\[Cucumber\] Progress Bar](https://www.ruby-forum.com/t/cucumber-progress-bar/159582)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 2\
**Last updated:** [February 8, 2009, 1:30am UTC](https://www.ruby-forum.com/t/cucumber-progress-bar/159582 "2009-02-08T01:30:33Z")

</div>

Inspired by Nick Evans’ RSpec progress bar\[1\], I had a little crack at implementing the progress bar for cucumber, 'cause I want to know how long a break I can take while the features are running :slight\_smile: It’s i…

---

## [Testing out cucumber scenario outline feature](https://www.ruby-forum.com/t/testing-out-cucumber-scenario-outline-feature/159726)

<div class="topic-metadata">

**Author:** [@Joaquin\_Rivera\_P](https://www.ruby-forum.com/u/Joaquin_Rivera_P)\
**Replies:** 2\
**Last updated:** [February 7, 2009, 9:23pm UTC](https://www.ruby-forum.com/t/testing-out-cucumber-scenario-outline-feature/159726 "2009-02-07T21:23:27Z")

</div>

hey there, I’ve been playing with Scenario Outline according to cucumber wiki. I have paste the tests made in gist:59920 · GitHub the short answers: http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines se…

---

## [How to write test cases in rcov](https://www.ruby-forum.com/t/how-to-write-test-cases-in-rcov/159693)

<div class="topic-metadata">

**Author:** [@brijesh](https://www.ruby-forum.com/u/brijesh)\
**Replies:** 1\
**Last updated:** [February 7, 2009, 9:01pm UTC](https://www.ruby-forum.com/t/how-to-write-test-cases-in-rcov/159693 "2009-02-07T21:01:45Z")

</div>

Hi I am using rcov to generate code coverage. But I don’t know how to write cases for that… I have installed rcov gem and and execute rcov test/\*.rb command. It shows me some code coverage in files. Can anyone help…

---

## [Redirects while using subdomains not working in 4.1](https://www.ruby-forum.com/t/redirects-while-using-subdomains-not-working-in-4-1/159561)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 7\
**Last updated:** [February 6, 2009, 7:53pm UTC](https://www.ruby-forum.com/t/redirects-while-using-subdomains-not-working-in-4-1/159561 "2009-02-06T19:53:34Z")

</div>

With the great help of David C., Scott T., and Dennis Z., redirecting while using a sub-domain worked in Dennis’ fork: git://github.com/zdennis/webrat.git. Unfortunately, after upgrading to 4.1 (so I could use set\_hid…

---

## [Is RSpec Ruby1.9 ready?](https://www.ruby-forum.com/t/is-rspec-ruby1-9-ready/159645)

<div class="topic-metadata">

**Author:** [@hayafirst](https://www.ruby-forum.com/u/hayafirst)\
**Replies:** 2\
**Last updated:** [February 6, 2009, 6:00pm UTC](https://www.ruby-forum.com/t/is-rspec-ruby1-9-ready/159645 "2009-02-06T18:00:52Z")

</div>

Hi, I saw a message on Nov, 2008 in this mailing list from David: “I’m not sure how to fix that problem, but before you go much further you should know that RSpec does not yet run under 1.9. It’s something I want to …

---

## [Can cucumber/webrat set a value on a hidden field](https://www.ruby-forum.com/t/can-cucumber-webrat-set-a-value-on-a-hidden-field/159463)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 2\
**Last updated:** [February 5, 2009, 8:04pm UTC](https://www.ruby-forum.com/t/can-cucumber-webrat-set-a-value-on-a-hidden-field/159463 "2009-02-05T20:04:55Z")

</div>

I am using auto\_complete to provide a list of persons from which the user can select one. On selection from the auto\_complete list, a hidden field is updated with the id of the selected person. This is all wrapped in …

---

## [\[rspec\] \[rails\] Specing a form builder](https://www.ruby-forum.com/t/rspec-rails-specing-a-form-builder/159552)

<div class="topic-metadata">

**Author:** [@chrisfinne](https://www.ruby-forum.com/u/chrisfinne)\
**Replies:** 1\
**Last updated:** [February 5, 2009, 6:13pm UTC](https://www.ruby-forum.com/t/rspec-rails-specing-a-form-builder/159552 "2009-02-05T18:13:20Z")

</div>

I’m trying to set up and run a new form builder under rails, which lives under the helpers directory, but isn’t really a helper. (Not a module, so doesn’t mix in well) Short of dropping down into a view spec, how do…

---

## [MyModel.stub!l works in 1.1.11 but fails in 1.1.12](https://www.ruby-forum.com/t/mymodel-stub-l-works-in-1-1-11-but-fails-in-1-1-12/159493)

<div class="topic-metadata">

**Author:** [@brad](https://www.ruby-forum.com/u/brad)\
**Replies:** 2\
**Last updated:** [February 5, 2009, 2:34pm UTC](https://www.ruby-forum.com/t/mymodel-stub-l-works-in-1-1-11-but-fails-in-1-1-12/159493 "2009-02-05T14:34:51Z")

</div>

I have a controller spec that works find with Rails 2.2.2 and Rspec- Rails 1.1.11. The code is: @activity=mock\_model(Activity, :id =\> 7) Activity.stub!(:get).with(“7”).and\_return(@activity When I update to 1.1.12 A…

---

## [Cucumber/Webrat fails to find fields when run after specs](https://www.ruby-forum.com/t/cucumber-webrat-fails-to-find-fields-when-run-after-specs/159460)

<div class="topic-metadata">

**Author:** [@fxp](https://www.ruby-forum.com/u/fxp)\
**Replies:** 8\
**Last updated:** [February 5, 2009, 11:40am UTC](https://www.ruby-forum.com/t/cucumber-webrat-fails-to-find-fields-when-run-after-specs/159460 "2009-02-05T11:40:05Z")

</div>

I’ve been battling the strangest behavior, and hoping someone can shed some light… I am using RSpec for MVC tests, and then Cucumber for stories/features. I am new to Cucumber, and recently finished converting our R…

---

## [Have\_tag with a block](https://www.ruby-forum.com/t/have-tag-with-a-block/159385)

<div class="topic-metadata">

**Author:** [@markmt](https://www.ruby-forum.com/u/markmt)\
**Replies:** 3\
**Last updated:** [February 4, 2009, 6:46am UTC](https://www.ruby-forum.com/t/have-tag-with-a-block/159385 "2009-02-04T06:46:37Z")

</div>

This is really a webrat question, but I haven’t had any reaction to this from the webrat group. Maybe someone here can offer a comment… I’ve been fooling around with webrat view matchers in merb / cucumber and I’m try…

---

## [Rcov - Specifying rake tasks](https://www.ruby-forum.com/t/rcov-specifying-rake-tasks/159357)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 3\
**Last updated:** [February 4, 2009, 2:21am UTC](https://www.ruby-forum.com/t/rcov-specifying-rake-tasks/159357 "2009-02-04T02:21:23Z")

</div>

I am trying to get a customized rcov rake task working. What I have so far looks like this: desc “Rcov code coverage reports” require ‘rcov/rcovtask’ require ‘spec/rake/spectask’ require ‘cucumber/rake/task’ task …

---

## [\[Cucumber\] 0.1.99.x parse errors](https://www.ruby-forum.com/t/cucumber-0-1-99-x-parse-errors/159297)

<div class="topic-metadata">

**Author:** [@aslakhellesoy](https://www.ruby-forum.com/u/aslakhellesoy)\
**Replies:** 2\
**Last updated:** [February 4, 2009, 12:33am UTC](https://www.ruby-forum.com/t/cucumber-0-1-99-x-parse-errors/159297 "2009-02-04T00:33:52Z")

</div>

Folks, If you encounter parse errors on 0.1.99.x (0.2 prereleases), please do the following: Create a http://gist.github.com/ with the full (but minimal) feature that fails to parse Got to the raw view of that gist …

---

## [Rspec and shoulda, together again at last](https://www.ruby-forum.com/t/rspec-and-shoulda-together-again-at-last/159373)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [February 3, 2009, 11:38pm UTC](https://www.ruby-forum.com/t/rspec-and-shoulda-together-again-at-last/159373 "2009-02-03T23:38:47Z")

</div>

Joe Ferris at thoughbot just announced the latest release of shoulda with an exciting new feature: RSpec-compatible ActiveRecord matchers! I’m excited about this for a few reasons. To quote Tammer Saleh, shoulda’s c…

---

## [Cucumber - but really ruby](https://www.ruby-forum.com/t/cucumber-but-really-ruby/159356)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 12\
**Last updated:** [February 3, 2009, 9:48pm UTC](https://www.ruby-forum.com/t/cucumber-but-really-ruby/159356 "2009-02-03T21:48:37Z")

</div>

In the cucumber rake task I see this construct: t.rcov\_opts = %w{--rails --exclude lib/ruby,lib64/ruby,/usr,osx/objc,gems/,test/,spec/,features/} t.rcov\_opts \<\< %\[–output “coverage”\] My questions is: What do %w and …

---

## [Rcov rake task problems](https://www.ruby-forum.com/t/rcov-rake-task-problems/159341)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 1\
**Last updated:** [February 3, 2009, 6:30pm UTC](https://www.ruby-forum.com/t/rcov-rake-task-problems/159341 "2009-02-03T18:30:51Z")

</div>

OS = MS-WinXPproSP3 / CYGWIN\_NT-5.1 1.5.25(0.156/4/2) 2008-06-12 19:34 ruby 1.8.7 (2008-08-11 patchlevel 72) \[i386-cygwin\] rails (2.2.2) rake (0.8.3) rcov (0.8.1.1.0) I am trying to develop a rake task that will agg…

---

## [Undefined method \`inherit' for Merb::Test::ExampleGroup](https://www.ruby-forum.com/t/undefined-method-inherit-for-merb-examplegroup/159166)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 8\
**Last updated:** [February 3, 2009, 3:26pm UTC](https://www.ruby-forum.com/t/undefined-method-inherit-for-merb-examplegroup/159166 "2009-02-03T15:26:24Z")

</div>

RSpeckers: I’m trying to install this into a Merb-generated RSpec rig: http://code.jeremyevans.net/doc/fixture\_dependencies/ It requires inserting their test case into RSpec. This is the documented way to do it: de…

---

## [\[Cucumber\] --dry-run](https://www.ruby-forum.com/t/cucumber-dry-run/159250)

<div class="topic-metadata">

**Author:** [@twaters](https://www.ruby-forum.com/u/twaters)\
**Replies:** 7\
**Last updated:** [February 3, 2009, 2:35am UTC](https://www.ruby-forum.com/t/cucumber-dry-run/159250 "2009-02-03T02:35:22Z")

</div>

Hi Guys, I see in the Cucmber --help that -d akd --dry-run is supported but it doesn’t seem to work. Anyone know why? Thanks, very much. Tim

---

## [\[Cucumber\] Cucumber and acts\_as\_xapian](https://www.ruby-forum.com/t/cucumber-cucumber-and-acts-as-xapian/159210)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 5\
**Last updated:** [February 2, 2009, 9:30pm UTC](https://www.ruby-forum.com/t/cucumber-cucumber-and-acts-as-xapian/159210 "2009-02-02T21:30:04Z")

</div>

Hey list, Anyone have experience with acts\_as\_xapian and Cucumber? I’m struggling with updating xapian’s index, to actually “find” fluff that has been indexed… In a scenario, I’m adding a bunch of articles, and in th…

---

## [RSpec - Testing ActiveRecord addins](https://www.ruby-forum.com/t/rspec-testing-activerecord-addins/158974)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 18\
**Last updated:** [February 2, 2009, 8:12pm UTC](https://www.ruby-forum.com/t/rspec-testing-activerecord-addins/158974 "2009-02-02T20:12:59Z")

</div>

I wish to test a small library that I have written. The module resides in a file in ./lib. It is loaded in the application via a a file in ./config/initializers that contains the following code: require ‘hll\_audit\_…

---

## [\[RSpec\] Cannot save or be\_valid when using xss\_terminate](https://www.ruby-forum.com/t/rspec-cannot-save-or-be-valid-when-using-xss-terminate/159236)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 2\
**Last updated:** [February 2, 2009, 6:07pm UTC](https://www.ruby-forum.com/t/rspec-cannot-save-or-be-valid-when-using-xss-terminate/159236 "2009-02-02T18:07:05Z")

</div>

Hi, I have a Rails app that uses xss\_terminate to sanitize the user input before it gets saved to the DB. In my specs when I call @product.should be\_valid or @product.save, I get the following error message: NoMethodE…

---

## [\[Cucumber\] and rake pass command-line params](https://www.ruby-forum.com/t/cucumber-and-rake-pass-command-line-params/159219)

<div class="topic-metadata">

**Author:** [@aap](https://www.ruby-forum.com/u/aap)\
**Replies:** 2\
**Last updated:** [February 2, 2009, 5:27pm UTC](https://www.ruby-forum.com/t/cucumber-and-rake-pass-command-line-params/159219 "2009-02-02T17:27:44Z")

</div>

Hi list, I might have not asked this correctly in previous post… and most definitely werenâ€™t clear! letâ€™s try again :slight\_smile: I canâ€™t seem to find any examples of using a rake variable in the Cucumber ta…

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

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