# RSpec

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

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

---

## [Specs and Libs](https://www.ruby-forum.com/t/specs-and-libs/116313)

<div class="topic-metadata">

**Author:** [@confundido](https://www.ruby-forum.com/u/confundido)\
**Replies:** 5\
**Last updated:** [October 6, 2007, 4:22am UTC](https://www.ruby-forum.com/t/specs-and-libs/116313 "2007-10-06T04:22:25Z")

</div>

How would I go about writing specs for a lib, particularly one with all protected and private methods. I’m trying to spec the AuthenticatedSystem library from the rails restful\_authentication plugin: http://pastie.c…

---

## [Rails, rSpec edge problems](https://www.ruby-forum.com/t/rails-rspec-edge-problems/116476)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 2\
**Last updated:** [October 5, 2007, 11:07pm UTC](https://www.ruby-forum.com/t/rails-rspec-edge-problems/116476 "2007-10-05T23:07:12Z")

</div>

Hi, Does the Story Runner work on edge rails? I thought that is what the example app was using but I am on the latest Rails and latest rSpec revisions and I am having problems. When I call ‘render\_template’ in a sto…

---

## [RSpec Trunk - Successful : Rake Aborted](https://www.ruby-forum.com/t/rspec-trunk-successful-rake-aborted/116477)

<div class="topic-metadata">

**Author:** [@Geoffrey\_W](https://www.ruby-forum.com/u/Geoffrey_W)\
**Replies:** 0\
**Last updated:** [October 5, 2007, 10:14pm UTC](https://www.ruby-forum.com/t/rspec-trunk-successful-rake-aborted/116477 "2007-10-05T22:14:34Z")

</div>

$ rake spec --trace (in /work/workspace/ng) \*\* Invoke spec (first\_time) \*\* Invoke db:test:prepare (first\_time) \*\* Invoke environment (first\_time) \*\* Execute environment \*\* Execute db:test:prepare \*\* Invoke db:test…

---

## [Rake & Story Runner](https://www.ruby-forum.com/t/rake-story-runner/116472)

<div class="topic-metadata">

**Author:** [@Geoffrey\_W](https://www.ruby-forum.com/u/Geoffrey_W)\
**Replies:** 1\
**Last updated:** [October 5, 2007, 9:54pm UTC](https://www.ruby-forum.com/t/rake-story-runner/116472 "2007-10-05T21:54:06Z")

</div>

So, having gotten a story (i.e. Story Runner) working (runs in NetBeans and using ‘ruby path/to/story.rb’), I’m looking to see how I’d integrate that with our build. Am I right in assuming that there’s no Rake integ…

---

## [Stories VS Scenarios](https://www.ruby-forum.com/t/stories-vs-scenarios/116465)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 2\
**Last updated:** [October 5, 2007, 9:10pm UTC](https://www.ruby-forum.com/t/stories-vs-scenarios/116465 "2007-10-05T21:10:45Z")

</div>

Hi all, I have read Dan N.'s post ‘Whats in a Story?’ (What's in a Story? - Dan North & Associates Ltd) but I am still having a hard time knowing when I should break requirements up into separate stories or keep them…

---

## [Cookies in RSpec](https://www.ruby-forum.com/t/cookies-in-rspec/116315)

<div class="topic-metadata">

**Author:** [@confundido](https://www.ruby-forum.com/u/confundido)\
**Replies:** 1\
**Last updated:** [October 5, 2007, 9:06am UTC](https://www.ruby-forum.com/t/cookies-in-rspec/116315 "2007-10-05T09:06:31Z")

</div>

So how do you work with cookies properly in rspec now? I noticed in the docs that it mentions session, assigns, and flash, but nothing of cookie. I’m using edge rails so I’m concerned about changes to the cookie mec…

---

## [Nested describe blocks](https://www.ruby-forum.com/t/nested-describe-blocks/116382)

<div class="topic-metadata">

**Author:** [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Replies:** 2\
**Last updated:** [October 5, 2007, 1:47am UTC](https://www.ruby-forum.com/t/nested-describe-blocks/116382 "2007-10-05T01:47:56Z")

</div>

In 1.0.8 I am able to nest describe blocks, but in moving to trunk, revision 2971, I am unable to have the expected results. Here is an example nested describe block: describe “foo” do describe “with no arguments” d…

---

## [TextMate language weirdness](https://www.ruby-forum.com/t/textmate-language-weirdness/116255)

<div class="topic-metadata">

**Author:** [@carlpulley](https://www.ruby-forum.com/u/carlpulley)\
**Replies:** 4\
**Last updated:** [October 5, 2007, 12:26am UTC](https://www.ruby-forum.com/t/textmate-language-weirdness/116255 "2007-10-05T00:26:43Z")

</div>

I’m having trouble with TextMate and assigning the RSpec language to \*\_spec.rb files within rails projects. Here is what is happening: I’m in a file that has the language “Ruby on Rails” selected. I do a ctrl-shift-d…

---

## [PUT- or POST-ing xml](https://www.ruby-forum.com/t/put-or-post-ing-xml/116378)

<div class="topic-metadata">

**Author:** [@Geoffrey\_W](https://www.ruby-forum.com/u/Geoffrey_W)\
**Replies:** 1\
**Last updated:** [October 5, 2007, 12:26am UTC](https://www.ruby-forum.com/t/put-or-post-ing-xml/116378 "2007-10-05T00:26:08Z")

</div>

I’d like to write a test of a REST service wherein XML is submitted as the request entity. In Test::Unit on Rails, this seems to be possible in an integration test, but not in a functional test. RSpec uses the Rail…

---

## [Using Predicates to look at an array](https://www.ruby-forum.com/t/using-predicates-to-look-at-an-array/116354)

<div class="topic-metadata">

**Author:** [@epasquier](https://www.ruby-forum.com/u/epasquier)\
**Replies:** 7\
**Last updated:** [October 4, 2007, 10:35pm UTC](https://www.ruby-forum.com/t/using-predicates-to-look-at-an-array/116354 "2007-10-04T22:35:32Z")

</div>

Hi all, I have an array of shipping\_type’s being returned, and I want to see what is in there. In the past I have done: shipping\_type.include?(Cart::SHIPPING\_TYPE\_REGULAR).should be\_true This works, but looks reall…

---

## [Re: align the runner](https://www.ruby-forum.com/t/re-align-the-runner/116223)

<div class="topic-metadata">

**Author:** [@Shane\_D](https://www.ruby-forum.com/u/Shane_D)\
**Replies:** 0\
**Last updated:** [October 3, 2007, 5:06pm UTC](https://www.ruby-forum.com/t/re-align-the-runner/116223 "2007-10-03T17:06:57Z")

</div>

Sorry, I just looked at the documentation and I meant runner extensions.

---

## [How to spec views](https://www.ruby-forum.com/t/how-to-spec-views/115977)

<div class="topic-metadata">

**Author:** [@bfsog](https://www.ruby-forum.com/u/bfsog)\
**Replies:** 15\
**Last updated:** [October 2, 2007, 9:34pm UTC](https://www.ruby-forum.com/t/how-to-spec-views/115977 "2007-10-02T21:34:56Z")

</div>

I’m trying to spec a view but haven’t done much view specing. This view render different partials depending on authentication of the user: annon, admin, player So I I’ll write if conditionals in the view with the par…

---

## [Re: align the runner](https://www.ruby-forum.com/t/re-align-the-runner/116141)

<div class="topic-metadata">

**Author:** [@Shane\_D](https://www.ruby-forum.com/u/Shane_D)\
**Replies:** 1\
**Last updated:** [October 2, 2007, 9:14pm UTC](https://www.ruby-forum.com/t/re-align-the-runner/116141 "2007-10-02T21:14:54Z")

</div>

Yes. Thanks. That probably means that the customer runner will work with both, if not already.

---

## [Rails 2.0 Preview Release and RSpec Trunk](https://www.ruby-forum.com/t/rails-2-0-preview-release-and-rspec-trunk/116139)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 6\
**Last updated:** [October 2, 2007, 8:49pm UTC](https://www.ruby-forum.com/t/rails-2-0-preview-release-and-rspec-trunk/116139 "2007-10-02T20:49:07Z")

</div>

Hi all, For those of you checking out the Rails 2.0 preview release: RSpec-1.0.8 does not support Rails 2.0. Unfortunately, we’re in the middle of some big changes to the internals in trunk and won’t be in a position…

---

## [Problems with testing nested routes using mocking](https://www.ruby-forum.com/t/problems-with-testing-nested-routes-using-mocking/115956)

<div class="topic-metadata">

**Author:** [@Jesper\_Laursen](https://www.ruby-forum.com/u/Jesper_Laursen)\
**Replies:** 9\
**Last updated:** [October 2, 2007, 8:49pm UTC](https://www.ruby-forum.com/t/problems-with-testing-nested-routes-using-mocking/115956 "2007-10-02T20:49:07Z")

</div>

Hello forum I have there to files #----- virtual\_host\_controller.rb class VirtualHostsController \< ApplicationController before\_filter :capture\_domain GET /domain/1/virtual\_hosts/1 def show @virtual\_host = @domain.…

---

## [Color output?](https://www.ruby-forum.com/t/color-output/116125)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 5\
**Last updated:** [October 2, 2007, 8:18pm UTC](https://www.ruby-forum.com/t/color-output/116125 "2007-10-02T20:18:36Z")

</div>

does story runner have commandline options ,eg to add color to output?

---

## [Align the runner](https://www.ruby-forum.com/t/align-the-runner/116137)

<div class="topic-metadata">

**Author:** [@Shane\_D](https://www.ruby-forum.com/u/Shane_D)\
**Replies:** 1\
**Last updated:** [October 2, 2007, 8:07pm UTC](https://www.ruby-forum.com/t/align-the-runner/116137 "2007-10-02T20:07:29Z")

</div>

I saw from the thread “color output” that there is a plan to “align the runner”. Is there a place to see what that means? I am just curious. Thanks Shane

---

## [Tarball anyone](https://www.ruby-forum.com/t/tarball-anyone/116061)

<div class="topic-metadata">

**Author:** [@barsalou](https://www.ruby-forum.com/u/barsalou)\
**Replies:** 3\
**Last updated:** [October 2, 2007, 7:24pm UTC](https://www.ruby-forum.com/t/tarball-anyone/116061 "2007-10-02T19:24:39Z")

</div>

Anyone willing to tar me up the 1.0.8 of rspec and rspec\_on\_rails? I’m interested in giving the story runner stuff a try. I really got to get svn going somehow. Mike B.

---

## [Rails 2.0 & rspec edge - not protected\_against\_forgery?](https://www.ruby-forum.com/t/rails-2-0-rspec-edge-not-protected-against-forgery/116107)

<div class="topic-metadata">

**Author:** [@Jens-Christian\_F](https://www.ruby-forum.com/u/Jens-Christian_F)\
**Replies:** 0\
**Last updated:** [October 2, 2007, 1:14pm UTC](https://www.ruby-forum.com/t/rails-2-0-rspec-edge-not-protected-against-forgery/116107 "2007-10-02T13:14:25Z")

</div>

The new forgery protection is throwing of rspec: NoMethodError in ‘ApplicationHelper login-logout when logged in should show the name of the current user’ undefined method protect\_against\_forgery?' for #\<#\<Class:0x321…

---

## [Flash in story runner](https://www.ruby-forum.com/t/flash-in-story-runner/116075)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 1\
**Last updated:** [October 2, 2007, 4:16am UTC](https://www.ruby-forum.com/t/flash-in-story-runner/116075 "2007-10-02T04:16:42Z")

</div>

hi, is there a way to assert a flash message directly in story runner? Or do I have to go through the response text instead. Then "flash message should say success" do #flash\[:notice\].should == "User succe…

---

## [Have\_tag and line numbers](https://www.ruby-forum.com/t/have-tag-and-line-numbers/116035)

<div class="topic-metadata">

**Author:** [@Geoffrey\_W](https://www.ruby-forum.com/u/Geoffrey_W)\
**Replies:** 1\
**Last updated:** [October 1, 2007, 7:37pm UTC](https://www.ruby-forum.com/t/have-tag-and-line-numbers/116035 "2007-10-01T19:37:08Z")

</div>

When I’ve got a view example like this: 1: response.should have\_tag “fieldset#children” do 2: with\_tag “child” 3: end If it can’t find ‘child’, the error seems to come back as my\_spec.rb:1 instead of my\_spec.rb:2. …

---

## [View Spec - Misbehaving](https://www.ruby-forum.com/t/view-spec-misbehaving/116021)

<div class="topic-metadata">

**Author:** [@Geoffrey\_W](https://www.ruby-forum.com/u/Geoffrey_W)\
**Replies:** 0\
**Last updated:** [October 1, 2007, 6:05pm UTC](https://www.ruby-forum.com/t/view-spec-misbehaving/116021 "2007-10-01T18:05:30Z")

</div>

I’m trying to write my first view spec; I’ve done some controller specs with integrated views, but thought that isolating the views for some of these tests might be nice. So I wrote this: @container = mock\_model(Pl…

---

## [Autotest stop working, 1.0.9?](https://www.ruby-forum.com/t/autotest-stop-working-1-0-9/115914)

<div class="topic-metadata">

**Author:** [@bfsog](https://www.ruby-forum.com/u/bfsog)\
**Replies:** 4\
**Last updated:** [October 1, 2007, 1:33pm UTC](https://www.ruby-forum.com/t/autotest-stop-working-1-0-9/115914 "2007-10-01T13:33:18Z")

</div>

My autotest runs but when I make changes to a spec it doesn’t reload. I checked another application I was building that had 1.0.9 but it was reloading fine. How would I debug a problem such as autotest not reloading?

---

## [How to write the very first example?](https://www.ruby-forum.com/t/how-to-write-the-very-first-example/115894)

<div class="topic-metadata">

**Author:** [@mlangenberg](https://www.ruby-forum.com/u/mlangenberg)\
**Replies:** 4\
**Last updated:** [September 30, 2007, 4:56pm UTC](https://www.ruby-forum.com/t/how-to-write-the-very-first-example/115894 "2007-09-30T16:56:22Z")

</div>

Many posts on this list are about using RSpec with Rails and that’s the way I’m also using RSpec all the time. Unfortunately there isn’t that much info about using RSpec for standalone Ruby projects. I must admit I…

---

## [How do I best setup data for Story Runner?](https://www.ruby-forum.com/t/how-do-i-best-setup-data-for-story-runner/115712)

<div class="topic-metadata">

**Author:** [@z1n](https://www.ruby-forum.com/u/z1n)\
**Replies:** 9\
**Last updated:** [September 29, 2007, 5:47pm UTC](https://www.ruby-forum.com/t/how-do-i-best-setup-data-for-story-runner/115712 "2007-09-29T17:47:47Z")

</div>

Just started looking at the Story Runner integration, and am converting a few Rails integration tests to get a feel for it. My integration tests relied on fixtures, and since my models have a significant amount of val…

---

## [Mock\_model named spaces not working](https://www.ruby-forum.com/t/mock-model-named-spaces-not-working/115852)

<div class="topic-metadata">

**Author:** [@bfsog](https://www.ruby-forum.com/u/bfsog)\
**Replies:** 1\
**Last updated:** [September 29, 2007, 8:10am UTC](https://www.ruby-forum.com/t/mock-model-named-spaces-not-working/115852 "2007-09-29T08:10:33Z")

</div>

I have a namespace called saltmines The following will fail the spec @player = mock\_model(Saltmines::Player) ActionView::TemplateError in ‘/saltmines/players/index.rhtml should render list of saltmines/players’ …

---

## [Form action url example](https://www.ruby-forum.com/t/form-action-url-example/115806)

<div class="topic-metadata">

**Author:** [@sinclair\_bain](https://www.ruby-forum.com/u/sinclair_bain)\
**Replies:** 2\
**Last updated:** [September 29, 2007, 4:30am UTC](https://www.ruby-forum.com/t/form-action-url-example/115806 "2007-09-29T04:30:03Z")

</div>

Hi, I have the following example: it ‘should have a form with an action attribute’ do response.should have\_tag( “form\[action=?\]”, ‘/users/1/machines/1/trouble\_tickets’) end for a form like so: \<% form\_for( :troubl…

---

## [Re: 1.0.8 tarball problem](https://www.ruby-forum.com/t/re-1-0-8-tarball-problem/115824)

<div class="topic-metadata">

**Author:** [@barsalou](https://www.ruby-forum.com/u/barsalou)\
**Replies:** 0\
**Last updated:** [September 28, 2007, 9:39pm UTC](https://www.ruby-forum.com/t/re-1-0-8-tarball-problem/115824 "2007-09-28T21:39:00Z")

</div>

Scott said: This was a known problem. I believe it should be fixed in the next release (fixed on trunk). Scott, Would that mean I have to use svn? I don’t have that option at the moment. Thanks for letting me kno…

---

## [There is a easy way to valid markup?](https://www.ruby-forum.com/t/there-is-a-easy-way-to-valid-markup/115721)

<div class="topic-metadata">

**Author:** [@eagoweb](https://www.ruby-forum.com/u/eagoweb)\
**Replies:** 3\
**Last updated:** [September 28, 2007, 2:43pm UTC](https://www.ruby-forum.com/t/there-is-a-easy-way-to-valid-markup/115721 "2007-09-28T14:43:02Z")

</div>

Do I have to create a custom Expectation Matcher? or there is a way to integrate assert\_valid\_asset plugin? thx

---

## [Testing emails with RSpec 1.0.8](https://www.ruby-forum.com/t/testing-emails-with-rspec-1-0-8/115763)

<div class="topic-metadata">

**Author:** [@fukas78](https://www.ruby-forum.com/u/fukas78)\
**Replies:** 1\
**Last updated:** [September 28, 2007, 11:08am UTC](https://www.ruby-forum.com/t/testing-emails-with-rspec-1-0-8/115763 "2007-09-28T11:08:37Z")

</div>

Anyone is doing email testing with RSpec? Can you post some examples? Thank you, Laco M.

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

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