# RSpec

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

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

---

## [Celerity and Webrat (using them together, Benchmarks, same API?)](https://www.ruby-forum.com/t/celerity-and-webrat-using-them-together-benchmarks-same-api/160364)

<div class="topic-metadata">

**Author:** [@Joaquin\_Rivera\_P](https://www.ruby-forum.com/u/Joaquin_Rivera_P)\
**Replies:** 2\
**Last updated:** [February 15, 2009, 7:45pm UTC](https://www.ruby-forum.com/t/celerity-and-webrat-using-them-together-benchmarks-same-api/160364 "2009-02-15T19:45:39Z")

</div>

hey there, I’ve been using Cucumber + Webrat for a while. The time has come to spec Js and Ajax, so I’ve been playing around with celerity features (with culerity until now). How usefull would be to have a common …

---

## [Testing misc methods in ApplicationController](https://www.ruby-forum.com/t/testing-misc-methods-in-applicationcontroller/129898)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 7\
**Last updated:** [February 14, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/testing-misc-methods-in-applicationcontroller/129898 "2009-02-14T23:32:22Z")

</div>

I’m already successfully testing before\_filters in application\_controller courtesy of this blog post: http://www.movesonrails.com/articles/2008/01/23/spec-ing-your-application-controller However, i can;'t work out ho…

---

## [Rspec Mentor or Paid Tutor Needed (near LA or remotely)](https://www.ruby-forum.com/t/rspec-mentor-or-paid-tutor-needed-near-la-or-remotely/160306)

<div class="topic-metadata">

**Author:** [@blueiguana](https://www.ruby-forum.com/u/blueiguana)\
**Replies:** 0\
**Last updated:** [February 14, 2009, 4:30am UTC](https://www.ruby-forum.com/t/rspec-mentor-or-paid-tutor-needed-near-la-or-remotely/160306 "2009-02-14T04:30:44Z")

</div>

I need someone who can help me with Rspec. Ideally someone in the Los Angeles area or else remotely via ichat. I can afford to pay up to $50/hour for 16 hours of training. Hopefully someone who’s truly enthusiastic ab…

---

## [The latest rspec clone](https://www.ruby-forum.com/t/the-latest-rspec-clone/160295)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 1\
**Last updated:** [February 13, 2009, 10:57pm UTC](https://www.ruby-forum.com/t/the-latest-rspec-clone/160295 "2009-02-13T22:57:47Z")

</div>

Turns out I’m in the market for a new car …

---

## [Is #valid? automatically called?](https://www.ruby-forum.com/t/is-valid-automatically-called/160193)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 10\
**Last updated:** [February 13, 2009, 5:57pm UTC](https://www.ruby-forum.com/t/is-valid-automatically-called/160193 "2009-02-13T17:57:31Z")

</div>

Does RSpec automatically call #valid? on ActiveRecord models? For instance, when this example is run: it ‘should reject a nil value’ do @form = TimeShiftForm.new :file =\> nil puts “@form.errors.count = \<\<#{@form.erro…

---

## [\[Cucumber\] running \`cucumber\` without a gem](https://www.ruby-forum.com/t/cucumber-running-cucumber-without-a-gem/160251)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 6\
**Last updated:** [February 13, 2009, 4:30pm UTC](https://www.ruby-forum.com/t/cucumber-running-cucumber-without-a-gem/160251 "2009-02-13T16:30:16Z")

</div>

Hey list, I have a test server, which doesn’t have cucumber as gem, so I unpacked it into vendor/gems. After some fiddling with load paths, it works. However, the “binary” cucumber command won’t run, since it needs t…

---

## [Cucumber - How to enable a disabled field](https://www.ruby-forum.com/t/cucumber-how-to-enable-a-disabled-field/160027)

<div class="topic-metadata">

**Author:** [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Replies:** 4\
**Last updated:** [February 13, 2009, 4:22pm UTC](https://www.ruby-forum.com/t/cucumber-how-to-enable-a-disabled-field/160027 "2009-02-13T16:22:22Z")

</div>

Is there way in Cucumber to enable a field or submit button that was disabled by default (:disable =\> true). I have a submit button which is enabled using javascript and would like to test the page using Cucumber. Tha…

---

## [\[Cucumber\] Http Post just returns status code and not Response-object](https://www.ruby-forum.com/t/cucumber-http-post-just-returns-status-code-and-not-response-object/160257)

<div class="topic-metadata">

**Author:** [@Felix\_Elliger](https://www.ruby-forum.com/u/Felix_Elliger)\
**Replies:** 1\
**Last updated:** [February 13, 2009, 3:17pm UTC](https://www.ruby-forum.com/t/cucumber-http-post-just-returns-status-code-and-not-response-object/160257 "2009-02-13T15:17:27Z")

</div>

Hi, I’m really new to cucumber-testing. I want to use an HTTP Post in my step-definitions using the post-method. When I execute response = post '/controller/action' response is of type Fixnum and contains only the s…

---

## [\[cucumber\]\[v0.2alpha\]Where could I find API docs for custom formatters?](https://www.ruby-forum.com/t/cucumber-v0-2alpha-where-could-i-find-api-docs-for-custom-formatters/160248)

<div class="topic-metadata">

**Author:** [@Yingnan\_L](https://www.ruby-forum.com/u/Yingnan_L)\
**Replies:** 2\
**Last updated:** [February 13, 2009, 12:37pm UTC](https://www.ruby-forum.com/t/cucumber-v0-2alpha-where-could-i-find-api-docs-for-custom-formatters/160248 "2009-02-13T12:37:11Z")

</div>

Hi, I’m working on update my local Cucumber to the latest version. But it seems the old formatter APIs(step\_failed, scenario\_executed, etc.) don’t work any more. Are there some documents or even Cucumber source code…

---

## [Issues with the trunk of rspec-rails](https://www.ruby-forum.com/t/issues-with-the-trunk-of-rspec-rails/160010)

<div class="topic-metadata">

**Author:** [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Replies:** 9\
**Last updated:** [February 13, 2009, 12:21am UTC](https://www.ruby-forum.com/t/issues-with-the-trunk-of-rspec-rails/160010 "2009-02-13T00:21:40Z")

</div>

Hi folks, I’m currently in the process of upgrading an old Rails project to the Rails 2.2.2 and the trunk of RSpec, and ran into several issues with rspec-rails. I’ve come up with workarounds for all of them, but I …

---

## [\[RSpec\] mock\_model not returning a mock](https://www.ruby-forum.com/t/rspec-mock-model-not-returning-a-mock/160192)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 1\
**Last updated:** [February 12, 2009, 8:04pm UTC](https://www.ruby-forum.com/t/rspec-mock-model-not-returning-a-mock/160192 "2009-02-12T20:04:46Z")

</div>

I’m experiencing some strange behaviour with an ActiveRecord model object. I’m trying to spec that a mocked AR object, @form, has an error on the “file” attribute. I’ve confirmed that there is an error on the “file” a…

---

## [Problem with refresh\_specs](https://www.ruby-forum.com/t/problem-with-refresh-specs/159997)

<div class="topic-metadata">

**Author:** [@jschank](https://www.ruby-forum.com/u/jschank)\
**Replies:** 3\
**Last updated:** [February 12, 2009, 6:53pm UTC](https://www.ruby-forum.com/t/problem-with-refresh-specs/159997 "2009-02-12T18:53:54Z")

</div>

Hello, I recently unpacked the latest (1.1.12) rspec and rspec rails in my applicaiton. When I run my specs I get: config.gem: Unpacked gem rspec-1.1.12 in vendor/gems has no specification file. Run ‘rake gems:refre…

---

## [Re: exemplary way to show a list is sorted?](https://www.ruby-forum.com/t/re-exemplary-way-to-show-a-list-is-sorted/160188)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [February 12, 2009, 6:14pm UTC](https://www.ruby-forum.com/t/re-exemplary-way-to-show-a-list-is-sorted/160188 "2009-02-12T18:14:59Z")

</div>

On Thu, Feb 12, 2009 at 9:25 AM, James B. removed\_email\_address@domain.invalid wrote: interpretation corrected. If this had been raised in person and not via email I venture that my question would have been answer…

---

## [Re: Sorry if this is a stupid question](https://www.ruby-forum.com/t/re-sorry-if-this-is-a-stupid-question/160162)

<div class="topic-metadata">

**Author:** [@BeatonS\_Malcolm](https://www.ruby-forum.com/u/BeatonS_Malcolm)\
**Replies:** 2\
**Last updated:** [February 12, 2009, 5:19pm UTC](https://www.ruby-forum.com/t/re-sorry-if-this-is-a-stupid-question/160162 "2009-02-12T17:19:28Z")

</div>

Hi everyone I am trying to run the CS examples using Iron ruby/ cucumber from the download and have hit a really irritating snag I have added a subtract method to the CS calculator - Re compiled - Added a features fi…

---

## [Exemplary way to show a list is sorted?](https://www.ruby-forum.com/t/exemplary-way-to-show-a-list-is-sorted/160003)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 15\
**Last updated:** [February 12, 2009, 4:25pm UTC](https://www.ruby-forum.com/t/exemplary-way-to-show-a-list-is-sorted/160003 "2009-02-12T16:25:34Z")

</div>

RSpeckers: I’m asserting that a list should be sorted by affinity. The following code is good enough for government work, but is there some more clever way to show that each element is equal or less than the previous …

---

## [How to test the code inside the block of the to\_xml function?](https://www.ruby-forum.com/t/how-to-test-the-code-inside-the-block-of-the-to-xml-function/159995)

<div class="topic-metadata">

**Author:** [@alex](https://www.ruby-forum.com/u/alex)\
**Replies:** 1\
**Last updated:** [February 12, 2009, 5:49am UTC](https://www.ruby-forum.com/t/how-to-test-the-code-inside-the-block-of-the-to-xml-function/159995 "2009-02-12T05:49:34Z")

</div>

Hi all, when I spec the to\_xml function like this: @some\_model.should\_receive(:to\_xml), it dskips the code located in the block, here is the controller code: … output = @detenteur.to\_xml( :skip\_types =\> false, :skip\_…

---

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

<div class="topic-metadata">

**Author:** [@rgagnon](https://www.ruby-forum.com/u/rgagnon)\
**Replies:** 2\
**Last updated:** [February 12, 2009, 4:14am UTC](https://www.ruby-forum.com/t/how-to-spec-within-a-block/160000 "2009-02-12T04:14:51Z")

</div>

I have this and I want to mock the to\_xml but not his block cause this is what I want to spec. Is there a way to do this? Sorry for the formatting output = @detenteur.to\_xml( :skip\_types =\> false, :skip\_instruct =\>…

---

## [Bizarre problem with Rake / Rcov](https://www.ruby-forum.com/t/bizarre-problem-with-rake-rcov/159567)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 3\
**Last updated:** [February 11, 2009, 6:00pm UTC](https://www.ruby-forum.com/t/bizarre-problem-with-rake-rcov/159567 "2009-02-11T18:00:01Z")

</div>

I am writing a custom rake task for rcov. The intent is top produce three variants of a test, each using slightly different options. This is the basic code: R\_RCOV\_AGGREG\_FILE = ‘coverage.data’ Use single quotes…

---

## [\[cucumber\] \[alpha\] The Backgrounder is run without cleaning up](https://www.ruby-forum.com/t/cucumber-alpha-the-backgrounder-is-run-without-cleaning-up/160026)

<div class="topic-metadata">

**Author:** [@chrisfinne](https://www.ruby-forum.com/u/chrisfinne)\
**Replies:** 2\
**Last updated:** [February 11, 2009, 5:00pm UTC](https://www.ruby-forum.com/t/cucumber-alpha-the-backgrounder-is-run-without-cleaning-up/160026 "2009-02-11T17:00:05Z")

</div>

This /could/ just a screwy behavior I’m seeing in SQL lite, but I don’t think so; normal scenarios are doing this just fine. I’m playing with the Background feature in the .1.99 beta, and it looks like it’s being run…

---

## [Best way of writing fetaures for a wizard](https://www.ruby-forum.com/t/best-way-of-writing-fetaures-for-a-wizard/160055)

<div class="topic-metadata">

**Author:** [@lucas](https://www.ruby-forum.com/u/lucas)\
**Replies:** 2\
**Last updated:** [February 11, 2009, 2:41pm UTC](https://www.ruby-forum.com/t/best-way-of-writing-fetaures-for-a-wizard/160055 "2009-02-11T14:41:26Z")

</div>

Hi everyone, I am Lucas and I am starting to use cucumber in project. I need to write a scenario that is little bit complex. Lets suppose I have a Thing and then I need to advance that Thing through 4 stages (someth…

---

## [How can this pass?](https://www.ruby-forum.com/t/how-can-this-pass/159810)

<div class="topic-metadata">

**Author:** [@sbayona](https://www.ruby-forum.com/u/sbayona)\
**Replies:** 16\
**Last updated:** [February 11, 2009, 4:55am UTC](https://www.ruby-forum.com/t/how-can-this-pass/159810 "2009-02-11T04:55:28Z")

</div>

how could this test pass? I have: class PropertiesController \< ApplicationController def show @property = Property.non\_existing\_method #causes a method missing error end end describe PropertiesController do def …

---

## [\[Cucumber\] Passing a variable from rake to steps file](https://www.ruby-forum.com/t/cucumber-passing-a-variable-from-rake-to-steps-file/159034)

<div class="topic-metadata">

**Author:** [@aap](https://www.ruby-forum.com/u/aap)\
**Replies:** 3\
**Last updated:** [February 11, 2009, 2:42am UTC](https://www.ruby-forum.com/t/cucumber-passing-a-variable-from-rake-to-steps-file/159034 "2009-02-11T02:42:12Z")

</div>

Can anybody tell me how to pass a variable from the rake command to my steps file using cucumber? I have the following in my Rakefile: Rakefile Cucumber::Rake::Task.new do |t| profile = ENV\[‘PROFILE’\] || ‘default’ …

---

## [Re: resource urls only work \*after\* a get() in controller spec](https://www.ruby-forum.com/t/re-resource-urls-only-work-after-a-get-in-controller-spec/159999)

<div class="topic-metadata">

**Author:** [@randy\_hendriawan](https://www.ruby-forum.com/u/randy_hendriawan)\
**Replies:** 3\
**Last updated:** [February 11, 2009, 12:12am UTC](https://www.ruby-forum.com/t/re-resource-urls-only-work-after-a-get-in-controller-spec/159999 "2009-02-11T00:12:24Z")

</div>

Okay, following up on this item. Would you believe a workaround of (gasp) get :index, prior to expecting route-based URLs to work? (slaps forehead). or do\_action(), provided by the host example group (the more conc…

---

## [\[ANN\] IRC rooms are now logged](https://www.ruby-forum.com/t/ann-irc-rooms-are-now-logged/160009)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 0\
**Last updated:** [February 10, 2009, 10:32pm UTC](https://www.ruby-forum.com/t/ann-irc-rooms-are-now-logged/160009 "2009-02-10T22:32:35Z")

</div>

Hey all, Thanks to Chris Schneider the rspec, cucumber, and #webrat freenode rooms are all being logged now! The logs can be found here: The code is all on github\[1\] so if you would like to add/change something jus…

---

## [(no subject)](https://www.ruby-forum.com/t/no-subject/160001)

<div class="topic-metadata">

**Author:** [@randy\_hendriawan](https://www.ruby-forum.com/u/randy_hendriawan)\
**Replies:** 0\
**Last updated:** [February 10, 2009, 8:55pm UTC](https://www.ruby-forum.com/t/no-subject/160001 "2009-02-10T20:55:25Z")

</div>

I’m encountering an interesting symptom during example execution. I’m making a shared example group that dries up belongs-to-me before\_filter testing, and it makes a callback to the example group that says it\_should\_…

---

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

<div class="topic-metadata">

**Author:** [@melvinram](https://www.ruby-forum.com/u/melvinram)\
**Replies:** 1\
**Last updated:** [February 10, 2009, 8:55pm UTC](https://www.ruby-forum.com/t/rspec-fails/159998 "2009-02-10T20:55:25Z")

</div>

From this code http://pastie.org/372777 I’m getting these errors http://pastie.org/372702 and it’s not making any sense… and it’s got me a little stuck. Some help pls?

---

## [The TODO note in rspec files can't be shown in "rake notes"](https://www.ruby-forum.com/t/the-todo-note-in-rspec-files-cant-be-shown-in-rake-notes/155373)

<div class="topic-metadata">

**Author:** [@Kai\_Fu](https://www.ruby-forum.com/u/Kai_Fu)\
**Replies:** 2\
**Last updated:** [February 10, 2009, 8:48pm UTC](https://www.ruby-forum.com/t/the-todo-note-in-rspec-files-cant-be-shown-in-rake-notes/155373 "2009-02-10T20:48:48Z")

</div>

Hello, I’ve written a “TODO” comment in a xxx\_controller\_spec.rb. When I run the “rake notes” command, it doesn’t appear in the output, while other notes written in the “app” dir are shown correctly. Could someone t…

---

## [RSpec testing AR results](https://www.ruby-forum.com/t/rspec-testing-ar-results/159994)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 0\
**Last updated:** [February 10, 2009, 8:10pm UTC](https://www.ruby-forum.com/t/rspec-testing-ar-results/159994 "2009-02-10T20:10:22Z")

</div>

The TDD/BDD stuff is really quite amazing. In order to construct tests on a library that I wrote to implement custom magic columns I have learned some extremely valuable information respecting date and time recording…

---

## [Using cucumber profiles with rake task](https://www.ruby-forum.com/t/using-cucumber-profiles-with-rake-task/159972)

<div class="topic-metadata">

**Author:** [@frankmt](https://www.ruby-forum.com/u/frankmt)\
**Replies:** 2\
**Last updated:** [February 10, 2009, 5:54pm UTC](https://www.ruby-forum.com/t/using-cucumber-profiles-with-rake-task/159972 "2009-02-10T17:54:38Z")

</div>

Hi, Im trying to set up an environment where I am able to run different cucumber profiles (webrat/selenium) in the same project. I did manage to make them work using the cucumber command, so this command works: cucu…

---

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

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 3\
**Last updated:** [February 9, 2009, 11:23pm UTC](https://www.ruby-forum.com/t/rspec-testing-activerecord-config-dependency/159870 "2009-02-09T23:23:21Z")

</div>

I have the following library code: def normal\_time\_now return DateTime.now.utc if default\_timezone == :utc return DateTime.now end This is dependent upon a setting in config/environment.rb Make Active Record use U…

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

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