# RSpec

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

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

---

## [Fixtures in Jruby Mysql](https://www.ruby-forum.com/t/fixtures-in-jruby-mysql/135367)

<div class="topic-metadata">

**Author:** [@thijs](https://www.ruby-forum.com/u/thijs)\
**Replies:** 1\
**Last updated:** [April 21, 2008, 5:30pm UTC](https://www.ruby-forum.com/t/fixtures-in-jruby-mysql/135367 "2008-04-21T17:30:05Z")

</div>

Hi, I’ve been developing a Rails frontend to a Java backend which is working great. I’m running into trouble now that I’m adding a few models though. All specs that use fixtures fail. Jruby gives this error message in…

---

## [\[ANN\] StepSpecr](https://www.ruby-forum.com/t/ann-stepspecr/135371)

<div class="topic-metadata">

**Author:** [@Matthias\_Hennemeyer](https://www.ruby-forum.com/u/Matthias_Hennemeyer)\
**Replies:** 0\
**Last updated:** [April 21, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/ann-stepspecr/135371 "2008-04-21T17:10:06Z")

</div>

Hi, I’ve written a micro-dsl to spec the step-implementations for rspec user stories. Here is a blog post about it: http://www.workunitgroup.com/2008/4/21/introducing-stepspecr It lives on github: Some info (from …

---

## [Is testing output within content\_for possible?](https://www.ruby-forum.com/t/is-testing-output-within-content-for-possible/135255)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 4\
**Last updated:** [April 20, 2008, 7:00pm UTC](https://www.ruby-forum.com/t/is-testing-output-within-content-for-possible/135255 "2008-04-20T19:00:01Z")

</div>

I wanted to test that the links below were being rendered in the views. content\_for :sidebar do %ul.links %li= edit\_link edit\_admin\_contact\_url(@contact), “Contact” view test it "should have the correct side bar lin…

---

## [Stubbing class in controller](https://www.ruby-forum.com/t/stubbing-class-in-controller/135210)

<div class="topic-metadata">

**Author:** [@Jamie\_D](https://www.ruby-forum.com/u/Jamie_D)\
**Replies:** 2\
**Last updated:** [April 19, 2008, 11:07pm UTC](https://www.ruby-forum.com/t/stubbing-class-in-controller/135210 "2008-04-19T23:07:52Z")

</div>

Hi, I am trying to stub a class in my controller and I can’t get it to work, the controller code is: def show @server = Server.find(params\[:id\]) whm = Whm::Client.new @server @server\_load = whm.loadavg end and my…

---

## [Debugging trick](https://www.ruby-forum.com/t/debugging-trick/135187)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 4\
**Last updated:** [April 19, 2008, 7:16pm UTC](https://www.ruby-forum.com/t/debugging-trick/135187 "2008-04-19T19:16:32Z")

</div>

Some have probably already discovered this but I’ve been working through some ui stories, using the rails integration test stuff. I had a story where one very used step was failing in one place. The failing expectati…

---

## [Rspec + github == !submodules](https://www.ruby-forum.com/t/rspec-github-submodules/135010)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 10\
**Last updated:** [April 19, 2008, 8:41am UTC](https://www.ruby-forum.com/t/rspec-github-submodules/135010 "2008-04-19T08:41:21Z")

</div>

Hey all, We ran into some problems last night with the repos up at github. We initially thought it was a git-submodules bug. We learned that it was something else, but in the process of trying to find the source of th…

---

## [Rspec test for converting a hash to a URL string](https://www.ruby-forum.com/t/rspec-test-for-converting-a-hash-to-a-url-string/134789)

<div class="topic-metadata">

**Author:** [@Jamie\_D](https://www.ruby-forum.com/u/Jamie_D)\
**Replies:** 2\
**Last updated:** [April 19, 2008, 8:10am UTC](https://www.ruby-forum.com/t/rspec-test-for-converting-a-hash-to-a-url-string/134789 "2008-04-19T08:10:54Z")

</div>

Hi all, I’ve written an expectation for a method that converts a hash into a url string of name/value pairs. The problem is that the hash is not traversed in the same order as it is defined so I can not work out how t…

---

## [Integration Test Uploading in Rails 2.0.2 was (Re: \[rspec-users\] Attachment-fu + Story Runner)](https://www.ruby-forum.com/t/integration-test-uploading-in-rails-2-0-2-was-re-rspec-users-attachment-fu-story-runner/135193)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 0\
**Last updated:** [April 19, 2008, 12:38am UTC](https://www.ruby-forum.com/t/integration-test-uploading-in-rails-2-0-2-was-re-rspec-users-attachment-fu-story-runner/135193 "2008-04-19T00:38:18Z")

</div>

On Fri, Apr 4, 2008 at 7:10 PM, Joe Van D. removed\_email\_address@domain.invalid wrote: It got in as changeset 8978 and should be in edge rails. Would it be worth it to monkeypatch that patch into rspec? Why woul…

---

## [Creating stories for the second resource. Very wet approach](https://www.ruby-forum.com/t/creating-stories-for-the-second-resource-very-wet-approach/134463)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 2\
**Last updated:** [April 18, 2008, 8:17pm UTC](https://www.ruby-forum.com/t/creating-stories-for-the-second-resource-very-wet-approach/134463 "2008-04-18T20:17:50Z")

</div>

Hi y’all I’m about to start writing up the stories for my second resource. The second resource is so similar to the first that I feel a good way for me to start might be to copy and paste the stories and edit from t…

---

## [Redirect\_to](https://www.ruby-forum.com/t/redirect-to/135141)

<div class="topic-metadata">

**Author:** [@andy](https://www.ruby-forum.com/u/andy)\
**Replies:** 6\
**Last updated:** [April 18, 2008, 2:23pm UTC](https://www.ruby-forum.com/t/redirect-to/135141 "2008-04-18T14:23:57Z")

</div>

OK I’m back and surely missing stuff again… In my controller tests I’m checking for a redirect after a destroy action. First up it’s a single resource (“map.resource :cart” in routes.rb) in CartsController.rb def de…

---

## [Story Framework](https://www.ruby-forum.com/t/story-framework/134931)

<div class="topic-metadata">

**Author:** [@SSSS\_eljko\_Filipin](https://www.ruby-forum.com/u/SSSS_eljko_Filipin)\
**Replies:** 2\
**Last updated:** [April 18, 2008, 12:14pm UTC](https://www.ruby-forum.com/t/story-framework/134931 "2008-04-18T12:14:35Z")

</div>

I want to use story framework for driving my (functional) Watir tests. I want to start with something simple, like logging in. I had an hour today to try it, and I did not get very far. (I have found http://rspec.inf…

---

## [How much details is enough?](https://www.ruby-forum.com/t/how-much-details-is-enough/135127)

<div class="topic-metadata">

**Author:** [@Matt\_Berther](https://www.ruby-forum.com/u/Matt_Berther)\
**Replies:** 5\
**Last updated:** [April 18, 2008, 11:51am UTC](https://www.ruby-forum.com/t/how-much-details-is-enough/135127 "2008-04-18T11:51:36Z")

</div>

Hi all, Long time lurker, first-time question. :slight\_smile: I’ve been going back and forth trying to decide how much detail is enough in my controller specs. I feel that if I put too much detail in them, then my te…

---

## [Writing a story for logging in with OpenID](https://www.ruby-forum.com/t/writing-a-story-for-logging-in-with-openid/134910)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 2\
**Last updated:** [April 17, 2008, 8:15pm UTC](https://www.ruby-forum.com/t/writing-a-story-for-logging-in-with-openid/134910 "2008-04-17T20:15:38Z")

</div>

So I added OpenID to my application (via the openid plugin). But I’m having troubles writing the story for it – specifically, how to mock the openid calls. Anyone got any quick pointers?

---

## [Abstract test runner?](https://www.ruby-forum.com/t/abstract-test-runner/135037)

<div class="topic-metadata">

**Author:** [@Bakken\_Jari](https://www.ruby-forum.com/u/Bakken_Jari)\
**Replies:** 0\
**Last updated:** [April 17, 2008, 12:10pm UTC](https://www.ruby-forum.com/t/abstract-test-runner/135037 "2008-04-17T12:10:48Z")

</div>

Hi, We have a quite large test suite built on Watir (and eventually moving to our soon-to-be-released JRuby wrapper for HtmlUnit). Currently the tests are written using Test::Unit, but we are looking at other solutio…

---

## [Stories / Pending / Suggestion](https://www.ruby-forum.com/t/stories-pending-suggestion/135032)

<div class="topic-metadata">

**Author:** [@joesniff](https://www.ruby-forum.com/u/joesniff)\
**Replies:** 0\
**Last updated:** [April 17, 2008, 11:10am UTC](https://www.ruby-forum.com/t/stories-pending-suggestion/135032 "2008-04-17T11:10:24Z")

</div>

Hello, I have a suggestion on plain text stories and how unimplemented Scenarios are regarded. When a Scenario has no Give/When/Body mark it as ‘pending’ rather than ‘completed’ as it does now. This would mean it w…

---

## [Testing Layout](https://www.ruby-forum.com/t/testing-layout/134942)

<div class="topic-metadata">

**Author:** [@andy](https://www.ruby-forum.com/u/andy)\
**Replies:** 4\
**Last updated:** [April 17, 2008, 7:38am UTC](https://www.ruby-forum.com/t/testing-layout/134942 "2008-04-17T07:38:06Z")

</div>

Is there a way to specify which layout an action should use in a controller? Andy

---

## [Setup for stories](https://www.ruby-forum.com/t/setup-for-stories/135003)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 2\
**Last updated:** [April 17, 2008, 1:01am UTC](https://www.ruby-forum.com/t/setup-for-stories/135003 "2008-04-17T01:01:36Z")

</div>

I’ve got some code that should run before any stories execute. Where’s a good place to put that? (need to create a @sessions and @users hash) Joe

---

## [Story runner + selenium-rc + wait\_for\_xxxx](https://www.ruby-forum.com/t/story-runner-selenium-rc-wait-for-xxxx/134994)

<div class="topic-metadata">

**Author:** [@andywatts](https://www.ruby-forum.com/u/andywatts)\
**Replies:** 2\
**Last updated:** [April 16, 2008, 11:15pm UTC](https://www.ruby-forum.com/t/story-runner-selenium-rc-wait-for-xxxx/134994 "2008-04-16T23:15:29Z")

</div>

Hi, I’ve got a story working with selenium-rc, but am stuck writing ajax-aware steps. How are people coding their story steps to wait for an Ajax event to complete? Here’s what I’ve looked at so far. $browser.wait…

---

## [Has anyone pulled from the repo recently, but not on/after 4/16?](https://www.ruby-forum.com/t/has-anyone-pulled-from-the-repo-recently-but-not-on-after-4-16/134976)

<div class="topic-metadata">

**Author:** [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Replies:** 7\
**Last updated:** [April 16, 2008, 9:47pm UTC](https://www.ruby-forum.com/t/has-anyone-pulled-from-the-repo-recently-but-not-on-after-4-16/134976 "2008-04-16T21:47:33Z")

</div>

I screwed up the repo on github and a bunch of commits are missing. So I’m hoping that there are a couple people out there that have pulled fairly recently (ideally on 4/15), but not today. If so, can you please tar …

---

## [Before\_validation callbacks bypassed when stubbing :valid?](https://www.ruby-forum.com/t/before-validation-callbacks-bypassed-when-stubbing-valid/134896)

<div class="topic-metadata">

**Author:** [@zubin](https://www.ruby-forum.com/u/zubin)\
**Replies:** 7\
**Last updated:** [April 16, 2008, 3:14pm UTC](https://www.ruby-forum.com/t/before-validation-callbacks-bypassed-when-stubbing-valid/134896 "2008-04-16T15:14:43Z")

</div>

I’m testing an ActiveRecord model using rspec and mocha, and found that if I stub out the :valid? method, all before\_validation callbacks are also skipped! Not ideal - I still want the callbacks to execute, but the va…

---

## [Rspec 1.1.4](https://www.ruby-forum.com/t/rspec-1-1-4/134930)

<div class="topic-metadata">

**Author:** [@jmcervera](https://www.ruby-forum.com/u/jmcervera)\
**Replies:** 2\
**Last updated:** [April 16, 2008, 11:38am UTC](https://www.ruby-forum.com/t/rspec-1-1-4/134930 "2008-04-16T11:38:15Z")

</div>

Hello. I have some troubles with rails edge and decide to try rspec-1.1.4. I have installed the plugins downloading the tarballs from github, and I have this error message when I run autotest. /home/jmcervera/work/ch…

---

## [Getting storyrunner success/failure status in rake task](https://www.ruby-forum.com/t/getting-storyrunner-success-failure-status-in-rake-task/134917)

<div class="topic-metadata">

**Author:** [@korny](https://www.ruby-forum.com/u/korny)\
**Replies:** 3\
**Last updated:** [April 16, 2008, 9:22am UTC](https://www.ruby-forum.com/t/getting-storyrunner-success-failure-status-in-rake-task/134917 "2008-04-16T09:22:45Z")

</div>

Hi folks - I’m trying to build a rake task to run our plain-text stories, both from a normal build and from our continuous integration server. However, I’m having a problem - running all.rb doesn’t return any sort of…

---

## [Textmate =\> pass, autotest =\> failing specs?](https://www.ruby-forum.com/t/textmate-pass-autotest-failing-specs/134851)

<div class="topic-metadata">

**Author:** [@giuseb](https://www.ruby-forum.com/u/giuseb)\
**Replies:** 5\
**Last updated:** [April 16, 2008, 12:24am UTC](https://www.ruby-forum.com/t/textmate-pass-autotest-failing-specs/134851 "2008-04-16T00:24:02Z")

</div>

Hi all, I hope I can get a quick pointer about the following problem: I have a controller spec with 38 examples, all green if run from within TextMate. From the shell, however (through either rake or autotest) I get …

---

## [Mocking and stubbing Rails' has\_many association](https://www.ruby-forum.com/t/mocking-and-stubbing-rails-has-many-association/134865)

<div class="topic-metadata">

**Author:** [@Eirik\_Dentz\_Sinclai](https://www.ruby-forum.com/u/Eirik_Dentz_Sinclai)\
**Replies:** 0\
**Last updated:** [April 15, 2008, 7:16pm UTC](https://www.ruby-forum.com/t/mocking-and-stubbing-rails-has-many-association/134865 "2008-04-15T19:16:33Z")

</div>

I’m somewhat new to testing and rspec. And I’m struggling a bit with the application of Mocks and Stubs in a Rails application. I think I’m beginning to grasp it, but I’m stuck on how to spec the following: I have a U…

---

## [Inspect STDERR in a story](https://www.ruby-forum.com/t/inspect-stderr-in-a-story/134581)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 4\
**Last updated:** [April 14, 2008, 9:10pm UTC](https://www.ruby-forum.com/t/inspect-stderr-in-a-story/134581 "2008-04-14T21:10:56Z")

</div>

Hi I have a story step that looks like this: When /(the user|then) runs “migrate (.\*)”/ do |\_, args| cd project\_dir do @output = #{migrate} #{args} end @output\_lines = @output.split(“\\n”) end Which is fine for te…

---

## [Request.params causing errors](https://www.ruby-forum.com/t/request-params-causing-errors/134546)

<div class="topic-metadata">

**Author:** [@reivilo](https://www.ruby-forum.com/u/reivilo)\
**Replies:** 4\
**Last updated:** [April 11, 2008, 10:38pm UTC](https://www.ruby-forum.com/t/request-params-causing-errors/134546 "2008-04-11T22:38:47Z")

</div>

Hello, I have a rhtml file that goes through the request.params. One of my test generates that file, but rspec pops an error saying : undefined method ‘params’ for … I’m not sure what to do with this, since request…

---

## [Easy way to specify protocol for a controller spec?](https://www.ruby-forum.com/t/easy-way-to-specify-protocol-for-a-controller-spec/134541)

<div class="topic-metadata">

**Author:** [@combray](https://www.ruby-forum.com/u/combray)\
**Replies:** 0\
**Last updated:** [April 11, 2008, 8:55pm UTC](https://www.ruby-forum.com/t/easy-way-to-specify-protocol-for-a-controller-spec/134541 "2008-04-11T20:55:51Z")

</div>

Hi all, I’d like to add some controller specs that use HTTPS rather than HTTP. I’ve poked a bit into the get() and post() methods that are provided by ControllerTestCase, but it doesn’t seem as though there’s an easy …

---

## [Does Ctrl-Shift-V in Textmate ever annoy you as an RSpec user?](https://www.ruby-forum.com/t/does-ctrl-shift-v-in-textmate-ever-annoy-you-as-an-rspec-user/134537)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 1\
**Last updated:** [April 11, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/does-ctrl-shift-v-in-textmate-ever-annoy-you-as-an-rspec-user/134537 "2008-04-11T20:41:41Z")

</div>

I love the TextMate feature of syntax checking ruby source with ^V. But often when I use it in an RSpec example group or a story steps file, I run into the problem that, although the file is syntactically correct, I g…

---

## [Mock\_model outside of rails](https://www.ruby-forum.com/t/mock-model-outside-of-rails/134522)

<div class="topic-metadata">

**Author:** [@Eric\_Smith](https://www.ruby-forum.com/u/Eric_Smith)\
**Replies:** 1\
**Last updated:** [April 11, 2008, 5:47pm UTC](https://www.ruby-forum.com/t/mock-model-outside-of-rails/134522 "2008-04-11T17:47:36Z")

</div>

Hello all. I have a quick mock\_model question. Is there a way to use it when doing ActiveRecord testing outside of rails? What I want to be able to do with my ActiveRecord is this: class Child belongs\_to :parent …

---

## [Stories - Use view matchers rather than assigns\[\].should?](https://www.ruby-forum.com/t/stories-use-view-matchers-rather-than-assigns-should/134362)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 21\
**Last updated:** [April 11, 2008, 4:26pm UTC](https://www.ruby-forum.com/t/stories-use-view-matchers-rather-than-assigns-should/134362 "2008-04-11T16:26:50Z")

</div>

Hi there, Just want to confirm I have this right. Writing a story, assigns\[:games\].length.should == 30 fails for me complaining assigns\[:games\] is nil. It seems assigns isn’t set for story steps? I’ve changed thi…

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

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