# RSpec

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

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

---

## [\[Cucumber\] How can I pass an XML block as a parameter?](https://www.ruby-forum.com/t/cucumber-how-can-i-pass-an-xml-block-as-a-parameter/165541)

<div class="topic-metadata">

**Author:** [@wolframarnold](https://www.ruby-forum.com/u/wolframarnold)\
**Replies:** 10\
**Last updated:** [April 15, 2009, 8:24pm UTC](https://www.ruby-forum.com/t/cucumber-how-can-i-pass-an-xml-block-as-a-parameter/165541 "2009-04-15T20:24:05Z")

</div>

We’re trying to verify XML REST API’s and would like to write Cucumber specs of the following type: Scenario: Create a phrase Given I have an authenticated session for user with login “steve” When I send a POST to /p…

---

## [Cucumber features for RSS feeds](https://www.ruby-forum.com/t/cucumber-features-for-rss-feeds/165430)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 1\
**Last updated:** [April 15, 2009, 6:17pm UTC](https://www.ruby-forum.com/t/cucumber-features-for-rss-feeds/165430 "2009-04-15T18:17:35Z")

</div>

I am moving into yet another area that I possess absolutely no experience with. In this case the realm of RSS feeds and Rails as the consumer. My first feature/scenario looks like this and, given the effort I had to …

---

## [RSpec makes me want to write better code](https://www.ruby-forum.com/t/rspec-makes-me-want-to-write-better-code/149513)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 52\
**Last updated:** [April 15, 2009, 5:45pm UTC](https://www.ruby-forum.com/t/rspec-makes-me-want-to-write-better-code/149513 "2009-04-15T17:45:59Z")

</div>

Hi, Today is a big day. I officially transitioned from manually testing by clicking around in my app, to automated testing with RSpec + Autotest. Yes RSpec made me find a few weaknesses in my app: while I was writing …

---

## [Specs for RSpec Matchers and Helpers](https://www.ruby-forum.com/t/specs-for-rspec-matchers-and-helpers/165602)

<div class="topic-metadata">

**Author:** [@devbanana](https://www.ruby-forum.com/u/devbanana)\
**Replies:** 2\
**Last updated:** [April 15, 2009, 5:36pm UTC](https://www.ruby-forum.com/t/specs-for-rspec-matchers-and-helpers/165602 "2009-04-15T17:36:54Z")

</div>

Hi, I’ve been extracting a lot of code out of my specs into their own matchers, helpers, and macros. I notice that the plugins that have their own specs, such as rspec-rails, and even RSpec itself, have specs for t…

---

## [How to test/spec an ActiveRecord find that uses :include](https://www.ruby-forum.com/t/how-to-test-spec-an-activerecord-find-that-uses-include/165594)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 4\
**Last updated:** [April 15, 2009, 5:24pm UTC](https://www.ruby-forum.com/t/how-to-test-spec-an-activerecord-find-that-uses-include/165594 "2009-04-15T17:24:36Z")

</div>

Hi, I was refactoring my model specs so that they don’t hit the database, but how to handle a custom find that uses :joins or :include with some important :conditions? I can’t see a way to not hit the database. Shoul…

---

## [Ambigous error while running cucumber features](https://www.ruby-forum.com/t/ambigous-error-while-running-cucumber-features/165584)

<div class="topic-metadata">

**Author:** [@goodneema](https://www.ruby-forum.com/u/goodneema)\
**Replies:** 0\
**Last updated:** [April 15, 2009, 3:04pm UTC](https://www.ruby-forum.com/t/ambigous-error-while-running-cucumber-features/165584 "2009-04-15T15:04:16Z")

</div>

Hello, I was just trying out a cucumber-java example with selenium integrated. My feature file has two scenarios and while executing the command “cucumber features”, It is executing the first scenario succesfully, bu…

---

## [Cucover: coverage-aware 'lazy' cucumber runs](https://www.ruby-forum.com/t/cucover-coverage-aware-lazy-cucumber-runs/165197)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 19\
**Last updated:** [April 15, 2009, 10:36am UTC](https://www.ruby-forum.com/t/cucover-coverage-aware-lazy-cucumber-runs/165197 "2009-04-15T10:36:27Z")

</div>

Hi Folks, This is an idea I’ve been playing with for some time, and I think I’ve finally it into a shape where it might be useful to other people. Cucover is a thin wrapper for Cucumber which makes it lazy. What does…

---

## [How to write a spec file for a helper](https://www.ruby-forum.com/t/how-to-write-a-spec-file-for-a-helper/165394)

<div class="topic-metadata">

**Author:** [@salil](https://www.ruby-forum.com/u/salil)\
**Replies:** 4\
**Last updated:** [April 15, 2009, 10:28am UTC](https://www.ruby-forum.com/t/how-to-write-a-spec-file-for-a-helper/165394 "2009-04-15T10:28:14Z")

</div>

How to write a spec file for a following helper module ArtistsHelper def round\_to(x) (self \* 10x).round.to\_f / 10x end end Regards salil

---

## [How to write a feature that calls for a prompt?](https://www.ruby-forum.com/t/how-to-write-a-feature-that-calls-for-a-prompt/165533)

<div class="topic-metadata">

**Author:** [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Replies:** 4\
**Last updated:** [April 15, 2009, 10:05am UTC](https://www.ruby-forum.com/t/how-to-write-a-feature-that-calls-for-a-prompt/165533 "2009-04-15T10:05:59Z")

</div>

I am writing a feature that will test an LDAP protected site. I need to login as my self with my real password. I’m thinking of writing a feature that looks something like this Feature: Login As a LDAP user I want …

---

## [How do you mock an object to expect A then B then A?](https://www.ruby-forum.com/t/how-do-you-mock-an-object-to-expect-a-then-b-then-a/165459)

<div class="topic-metadata">

**Author:** [@nigelthorne](https://www.ruby-forum.com/u/nigelthorne)\
**Replies:** 4\
**Last updated:** [April 15, 2009, 8:41am UTC](https://www.ruby-forum.com/t/how-do-you-mock-an-object-to-expect-a-then-b-then-a/165459 "2009-04-15T08:41:30Z")

</div>

Hi Folks, I want to assert on an order of interaction between two objects where one method gets repeated. Here is a simple example… this fails "Mock ‘x’ expected :a with (any args) once, but received it twice" x =…

---

## [\[Cucumber\] features.txt](https://www.ruby-forum.com/t/cucumber-features-txt/165521)

<div class="topic-metadata">

**Author:** [@twaters](https://www.ruby-forum.com/u/twaters)\
**Replies:** 3\
**Last updated:** [April 15, 2009, 3:49am UTC](https://www.ruby-forum.com/t/cucumber-features-txt/165521 "2009-04-15T03:49:28Z")

</div>

Hi Guys, My nightly tests stopped working suddenly over the weekend. Not sure why yet. It’s wierd because they just look like the exited without a clue mid-test. Nothing in the logs is a smoking gun. Here’s my questi…

---

## [Various results from same test](https://www.ruby-forum.com/t/various-results-from-same-test/165484)

<div class="topic-metadata">

**Author:** [@Jeremiah\_Heller](https://www.ruby-forum.com/u/Jeremiah_Heller)\
**Replies:** 2\
**Last updated:** [April 14, 2009, 10:17pm UTC](https://www.ruby-forum.com/t/various-results-from-same-test/165484 "2009-04-14T22:17:29Z")

</div>

Hi, I’ve read on the ‘Cucumber Backgrounder’ page that running cuc via rake, command line and autotest could give different results but I seem to get different results depending on the path I pass cucumber and am not…

---

## [\[Cucumber\] ANN: Cucumber 0.3.0](https://www.ruby-forum.com/t/cucumber-ann-cucumber-0-3-0/165526)

<div class="topic-metadata">

**Author:** [@aslakhellesoy](https://www.ruby-forum.com/u/aslakhellesoy)\
**Replies:** 0\
**Last updated:** [April 14, 2009, 9:15pm UTC](https://www.ruby-forum.com/t/cucumber-ann-cucumber-0-3-0/165526 "2009-04-14T21:15:46Z")

</div>

The full changelog is here: http://github.com/aslakhellesoy/cucumber/blob/98eefc22f50371e8c3bd02ef8715176d6f586198/History.txt Enjoy! The Cucumber team (Aslak, Joseph, Ben)

---

## [OT: RSpec support in rails.vim](https://www.ruby-forum.com/t/ot-rspec-support-in-rails-vim/165510)

<div class="topic-metadata">

**Author:** [@devbanana](https://www.ruby-forum.com/u/devbanana)\
**Replies:** 0\
**Last updated:** [April 14, 2009, 5:39pm UTC](https://www.ruby-forum.com/t/ot-rspec-support-in-rails-vim/165510 "2009-04-14T17:39:04Z")

</div>

Hi, The rails plugin for vim has limited RSpec support, and it mentions how to add extra commands such as speccontroller, etc, with Rcommand. Has anyone done this? I’m not very good with the syntax of .vimrc, so I d…

---

## [How to write a spec for an actionmailer method](https://www.ruby-forum.com/t/how-to-write-a-spec-for-an-actionmailer-method/165390)

<div class="topic-metadata">

**Author:** [@salil](https://www.ruby-forum.com/u/salil)\
**Replies:** 3\
**Last updated:** [April 14, 2009, 4:11pm UTC](https://www.ruby-forum.com/t/how-to-write-a-spec-for-an-actionmailer-method/165390 "2009-04-14T16:11:22Z")

</div>

how to write a spec for an actionmailer method. following is the method of action controller. class Notifier \< ActionMailer::Base def conta(username ,adresseemail,code) @subject = ‘Admin Confirmation Mail’ @recipie…

---

## [\[Cucumber\] attribute readers in World?](https://www.ruby-forum.com/t/cucumber-attribute-readers-in-world/165487)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 1\
**Last updated:** [April 14, 2009, 2:59pm UTC](https://www.ruby-forum.com/t/cucumber-attribute-readers-in-world/165487 "2009-04-14T14:59:46Z")

</div>

Hi, #env.rb class ProjectWorld include Spec::Matchers def browser @browser ||= Browser.new end end World do ProjectWorld.new end Instead of using explicit getters here, can I not use attribute readers? Aidy

---

## [\[Cucumber\] any examples of navigating cucumber parse tree from external script](https://www.ruby-forum.com/t/cucumber-any-examples-of-navigating-cucumber-parse-tree-from-external-script/164991)

<div class="topic-metadata">

**Author:** [@korny](https://www.ruby-forum.com/u/korny)\
**Replies:** 6\
**Last updated:** [April 14, 2009, 12:17pm UTC](https://www.ruby-forum.com/t/cucumber-any-examples-of-navigating-cucumber-parse-tree-from-external-script/164991 "2009-04-14T12:17:39Z")

</div>

Hi folks, I’m writing some scripts to integrate our cucumber features with stories stored in a wiki, and I’m hoping to use cucumber’s parser to parse the features rather than doing it manually. (I don’t really care a…

---

## [Problem seeing and accessing RSpec gems](https://www.ruby-forum.com/t/problem-seeing-and-accessing-rspec-gems/165415)

<div class="topic-metadata">

**Author:** [@sarahg](https://www.ruby-forum.com/u/sarahg)\
**Replies:** 10\
**Last updated:** [April 13, 2009, 10:48pm UTC](https://www.ruby-forum.com/t/problem-seeing-and-accessing-rspec-gems/165415 "2009-04-13T22:48:10Z")

</div>

Hello RSpec-list: I’m having trouble getting rspec and rspec-rails correctly installed on my system. (I had to uninstall, unfortunately).The upshot is that even when they are installed – i.e. when I can see them on m…

---

## [\[cucumber\] Cucumber and restful\_authentication](https://www.ruby-forum.com/t/cucumber-cucumber-and-restful-authentication/196935)

<div class="topic-metadata">

**Author:** [@tadatoshi](https://www.ruby-forum.com/u/tadatoshi)\
**Replies:** 1\
**Last updated:** [April 13, 2009, 9:42pm UTC](https://www.ruby-forum.com/t/cucumber-cucumber-and-restful-authentication/196935 "2009-04-13T21:42:28Z")

</div>

Hi, I have just started to use Cucumber. I’m struggling to use Cucumber on the feature that is available only to the logged in user. Could anybody provide the codes that need to be added? The sites I found by Google…

---

## [Passing self to matchers](https://www.ruby-forum.com/t/passing-self-to-matchers/165371)

<div class="topic-metadata">

**Author:** [@devbanana](https://www.ruby-forum.com/u/devbanana)\
**Replies:** 1\
**Last updated:** [April 13, 2009, 12:41pm UTC](https://www.ruby-forum.com/t/passing-self-to-matchers/165371 "2009-04-13T12:41:29Z")

</div>

Hi, I’ve noticed in several matchers that the matcher method passes self to the constructor of the class. Then that’s used to call several of the methods used. For instance, in RouteFor, self is passed, and it is us…

---

## [Cucumber - Recommended viewing](https://www.ruby-forum.com/t/cucumber-recommended-viewing/165266)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 10\
**Last updated:** [April 13, 2009, 8:36am UTC](https://www.ruby-forum.com/t/cucumber-recommended-viewing/165266 "2009-04-13T08:36:13Z")

</div>

http://mwrc2009.confreaks.com/14-mar-2009-15-00-bdd-with-cucumber-ben-mabey.html

---

## [Custom matcher, use other helpers and matchers from rspec-rails](https://www.ruby-forum.com/t/custom-matcher-use-other-helpers-and-matchers-from-rspec-rails/165356)

<div class="topic-metadata">

**Author:** [@devbanana](https://www.ruby-forum.com/u/devbanana)\
**Replies:** 3\
**Last updated:** [April 13, 2009, 4:07am UTC](https://www.ruby-forum.com/t/custom-matcher-use-other-helpers-and-matchers-from-rspec-rails/165356 "2009-04-13T04:07:20Z")

</div>

Hi, I am creating an improved version of route\_for that is more intuitive to me. However, I keep getting NoMethodError exceptions, so am trying to find all the includes I have to put into my class. What’s the best …

---

## [\[cucumber\] Cucumber and restful\_authentication](https://www.ruby-forum.com/t/cucumber-cucumber-and-restful-authentication/165188)

<div class="topic-metadata">

**Author:** [@tadatoshi](https://www.ruby-forum.com/u/tadatoshi)\
**Replies:** 4\
**Last updated:** [April 12, 2009, 11:41pm UTC](https://www.ruby-forum.com/t/cucumber-cucumber-and-restful-authentication/165188 "2009-04-12T23:41:04Z")

</div>

Hi, I have just started to use Cucumber. I’m struggling to use Cucumber on the feature that is available only to the logged in user. Could anybody provide the codes that need to be added? The sites I found by Google…

---

## [How to Spec a Web Services Client](https://www.ruby-forum.com/t/how-to-spec-a-web-services-client/165344)

<div class="topic-metadata">

**Author:** [@cwd](https://www.ruby-forum.com/u/cwd)\
**Replies:** 3\
**Last updated:** [April 12, 2009, 10:47pm UTC](https://www.ruby-forum.com/t/how-to-spec-a-web-services-client/165344 "2009-04-12T22:47:13Z")

</div>

I put a pastie out at http://pastie.org/444424, which is an implementation (short) of an XML-RPC client. I’m getting wrapped around an axle trying to figure out how to spec this without actually hitting the remote ser…

---

## [Superclass mismatch for class ModelExampleGroup (TypeError)](https://www.ruby-forum.com/t/superclass-mismatch-for-class-modelexamplegroup-typeerror/164994)

<div class="topic-metadata">

**Author:** [@Andrew\_Zielinski](https://www.ruby-forum.com/u/Andrew_Zielinski)\
**Replies:** 4\
**Last updated:** [April 11, 2009, 3:05pm UTC](https://www.ruby-forum.com/t/superclass-mismatch-for-class-modelexamplegroup-typeerror/164994 "2009-04-11T15:05:01Z")

</div>

I hope somebody can help me with this. I can’t seem to run spec\_server with rails 2.3.2 using rspec/rspec-rails 1.2.2. I’m also using mocha 0.9.5 and remarkable 2.3.0. Thanks Andrew Here is the stack trace: /Librar…

---

## [Reuse of Cucumber Features](https://www.ruby-forum.com/t/reuse-of-cucumber-features/155579)

<div class="topic-metadata">

**Author:** [@sjmadsen](https://www.ruby-forum.com/u/sjmadsen)\
**Replies:** 17\
**Last updated:** [April 11, 2009, 1:47pm UTC](https://www.ruby-forum.com/t/reuse-of-cucumber-features/155579 "2009-04-11T13:47:45Z")

</div>

What’s the best way to handle a requirement that shows up as a sub-requirement requirement in other features? For example let’s say users can enter dates in various forms throughout my application. There is one s…

---

## [Cucumber stripping the letter "a" on windows](https://www.ruby-forum.com/t/cucumber-stripping-the-letter-a-on-windows/165267)

<div class="topic-metadata">

**Author:** [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Replies:** 2\
**Last updated:** [April 11, 2009, 9:54am UTC](https://www.ruby-forum.com/t/cucumber-stripping-the-letter-a-on-windows/165267 "2009-04-11T09:54:22Z")

</div>

It looks like cucumber is having the problem with the letter “a” again … a problem with handling the angstrom character and windows: Feture: list the vilble repositories So tht I cn subscribe to repositories I wnt to…

---

## [Then I should be on /users/3/posts/8/comments/2/edit](https://www.ruby-forum.com/t/then-i-should-be-on-users-3-posts-8-comments-2-edit/165206)

<div class="topic-metadata">

**Author:** [@gavvin](https://www.ruby-forum.com/u/gavvin)\
**Replies:** 10\
**Last updated:** [April 11, 2009, 5:51am UTC](https://www.ruby-forum.com/t/then-i-should-be-on-users-3-posts-8-comments-2-edit/165206 "2009-04-11T05:51:13Z")

</div>

“Then I should be on /users/3/posts/8/comments/2/edit” What’s the solution for parsing out and matching and arbitrarily deep nested route?

---

## [\[cucumber\]\[rails\] trouble with authlogic tests](https://www.ruby-forum.com/t/cucumber-rails-trouble-with-authlogic-tests/165179)

<div class="topic-metadata">

**Author:** [@scottnj](https://www.ruby-forum.com/u/scottnj)\
**Replies:** 1\
**Last updated:** [April 11, 2009, 3:10am UTC](https://www.ruby-forum.com/t/cucumber-rails-trouble-with-authlogic-tests/165179 "2009-04-11T03:10:15Z")

</div>

i am trying to learn testing for rails apps. i followed the two authlogic tutorials (basic authlogic setup and password reset) and now i am trying to add some integration tests with cucumber (i know you are supposed t…

---

## [Where's an example of an RSpec'd Rails or Merb site with RJS calls?](https://www.ruby-forum.com/t/wheres-an-example-of-an-rspecd-rails-or-merb-site-with-rjs-calls/165245)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 1\
**Last updated:** [April 11, 2009, 1:30am UTC](https://www.ruby-forum.com/t/wheres-an-example-of-an-rspecd-rails-or-merb-site-with-rjs-calls/165245 "2009-04-11T01:30:47Z")

</div>

RSpeckers: The time has come to plug assert\_rjs\_ into a matcher providing a grammar like “should generate\_js\_to :replace\_html…”. Does anyone have a lite website that uses Ajax and RSpec, for a reference implementat…

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

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