# RSpec

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

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

---

## [Date comparisons](https://www.ruby-forum.com/t/date-comparisons/136562)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 11\
**Last updated:** [May 5, 2008, 7:00pm UTC](https://www.ruby-forum.com/t/date-comparisons/136562 "2008-05-05T19:00:16Z")

</div>

I occasionally get this error: ‘A puzzle once featured, should no longer be nominated’ FAILED expected: Sun May 04 09:10:26 -0700 2008, got: Sun May 04 09:10:26 -0700 2008 (using ==) ./spec/models/puzzle\_spec.rb:…

---

## [Problems with redirect\_to](https://www.ruby-forum.com/t/problems-with-redirect-to/129900)

<div class="topic-metadata">

**Author:** [@MaurSSS\_cio\_Linhare](https://www.ruby-forum.com/u/MaurSSS_cio_Linhare)\
**Replies:** 6\
**Last updated:** [May 5, 2008, 5:42pm UTC](https://www.ruby-forum.com/t/problems-with-redirect-to/129900 "2008-05-05T17:42:11Z")

</div>

Hello guys, I have the following spec: describe 'With successful save' do it 'Should redirect to the new page' do do\_post response.should be\_redirect response.should redirect\_to( :action =\> 'show', :id =\>…

---

## [Do message expectations work in story steps?](https://www.ruby-forum.com/t/do-message-expectations-work-in-story-steps/136642)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 0\
**Last updated:** [May 5, 2008, 2:44am UTC](https://www.ruby-forum.com/t/do-message-expectations-work-in-story-steps/136642 "2008-05-05T02:44:15Z")

</div>

I’ve never tried to use them myself, but another list member brought this up in another thread. He was using a message expectation in a story step, and couldn’t get it to fail. Looking at what he was doing, it didn’t…

---

## [Everyone Using Rspec Autotest?](https://www.ruby-forum.com/t/everyone-using-rspec-autotest/136575)

<div class="topic-metadata">

**Author:** [@bfsog](https://www.ruby-forum.com/u/bfsog)\
**Replies:** 6\
**Last updated:** [May 4, 2008, 6:40pm UTC](https://www.ruby-forum.com/t/everyone-using-rspec-autotest/136575 "2008-05-04T18:40:27Z")

</div>

I haven’t been spec’ing lately, but been hopping back on and adding autotest. However I get an error: http://pastie.caboo.se/177538/wrap I also noticed a post by Scott and there was mention of rspec\_autotest. Is thi…

---

## [Silly partial qu](https://www.ruby-forum.com/t/silly-partial-qu/136579)

<div class="topic-metadata">

**Author:** [@sshingler](https://www.ruby-forum.com/u/sshingler)\
**Replies:** 4\
**Last updated:** [May 4, 2008, 4:36pm UTC](https://www.ruby-forum.com/t/silly-partial-qu/136579 "2008-05-04T16:36:45Z")

</div>

hi all, i’m just trying to check a partial has been rendered, by using: response.template.should\_receive(:render).with(:partial =\> “tasks/list”) this passes, even if I put something bogus in the partial name, such as: …

---

## [BDD/Rails/Shoulda](https://www.ruby-forum.com/t/bdd-rails-shoulda/135760)

<div class="topic-metadata">

**Author:** [@turnkeytraders](https://www.ruby-forum.com/u/turnkeytraders)\
**Replies:** 14\
**Last updated:** [May 4, 2008, 5:15am UTC](https://www.ruby-forum.com/t/bdd-rails-shoulda/135760 "2008-05-04T05:15:25Z")

</div>

This is a little off topic, but I use rSpec and IÂ¹m starting to question the quality of my specs. In my research and attempt to learn how to write better specs, IÂ¹ve came across a few things that IÂ¹d like to discu…

---

## [Re: spec'ing calls to super (or other Ruby keywords)](https://www.ruby-forum.com/t/re-specing-calls-to-super-or-other-ruby-keywords/136587)

<div class="topic-metadata">

**Author:** [@Al\_Chou](https://www.ruby-forum.com/u/Al_Chou)\
**Replies:** 0\
**Last updated:** [May 4, 2008, 1:00am UTC](https://www.ruby-forum.com/t/re-specing-calls-to-super-or-other-ruby-keywords/136587 "2008-05-04T01:00:25Z")

</div>

Funny, I mostly like writing RSpec specs for Rails, aside from the fact that it sometimes takes me a while to figure out exactly how and what I need to write to specify what I want to specify. In any case, I agree tha…

---

## [Re: spec'ing calls to super (or other Ruby keywords)](https://www.ruby-forum.com/t/re-specing-calls-to-super-or-other-ruby-keywords/136558)

<div class="topic-metadata">

**Author:** [@Al\_Chou](https://www.ruby-forum.com/u/Al_Chou)\
**Replies:** 1\
**Last updated:** [May 3, 2008, 10:55pm UTC](https://www.ruby-forum.com/t/re-specing-calls-to-super-or-other-ruby-keywords/136558 "2008-05-03T22:55:26Z")

</div>

In the particular case of super, another approach, though perhaps not using the spec framework, would be to assert (a la Test::Unit) that your class is a subclass of the intended superclass. To be truly anal, also as…

---

## [Spec'ing calls to super (or other Ruby keywords)](https://www.ruby-forum.com/t/specing-calls-to-super-or-other-ruby-keywords/136517)

<div class="topic-metadata">

**Author:** [@Matt\_McNeil](https://www.ruby-forum.com/u/Matt_McNeil)\
**Replies:** 1\
**Last updated:** [May 3, 2008, 4:56pm UTC](https://www.ruby-forum.com/t/specing-calls-to-super-or-other-ruby-keywords/136517 "2008-05-03T16:56:53Z")

</div>

Hi there, How does one spec an invocation of a Ruby keyword, such as super in this case? class User \< ActiveResource::Base faking the ActiveRecord before/after\_save observers def save super UserMailer.deliver\_acti…

---

## [Return code for running stories](https://www.ruby-forum.com/t/return-code-for-running-stories/136510)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [May 3, 2008, 10:35am UTC](https://www.ruby-forum.com/t/return-code-for-running-stories/136510 "2008-05-03T10:35:23Z")

</div>

Hi all! Just wrote a few stories and committed code to a project of mine, then realized I made a mistake (with the commit, not the code or tests). It would be nice to put the script that runs the stories as a pre-com…

---

## [Autotest / rspec not failing tests](https://www.ruby-forum.com/t/autotest-rspec-not-failing-tests/136342)

<div class="topic-metadata">

**Author:** [@johnpetterson](https://www.ruby-forum.com/u/johnpetterson)\
**Replies:** 0\
**Last updated:** [May 1, 2008, 12:56am UTC](https://www.ruby-forum.com/t/autotest-rspec-not-failing-tests/136342 "2008-05-01T00:56:56Z")

</div>

Hi all, Bit of a noob problem. I’m attempting to get autotest / rspec running on my OSX 1.5 machine. Everything is the latest version. My test looks like: require ‘test/unit’ class TestString \< Test::Unit::TestCase …

---

## [ANN: RSpactor 0.9.10 (aka. beta)](https://www.ruby-forum.com/t/ann-rspactor-0-9-10-aka-beta/136095)

<div class="topic-metadata">

**Author:** [@rubyphunk](https://www.ruby-forum.com/u/rubyphunk)\
**Replies:** 9\
**Last updated:** [April 30, 2008, 10:22pm UTC](https://www.ruby-forum.com/t/ann-rspactor-0-9-10-aka-beta/136095 "2008-04-30T22:22:53Z")

</div>

Hey all. I’ve just release a first preview/beta of the upcoming RSpactor.app; a spec runner for Mac OS X Leopard. This is just some kind of test version and I’m looking for people who love to sit on the edge …

---

## [Odd fixture behavior](https://www.ruby-forum.com/t/odd-fixture-behavior/136236)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 1\
**Last updated:** [April 30, 2008, 5:15am UTC](https://www.ruby-forum.com/t/odd-fixture-behavior/136236 "2008-04-30T05:15:41Z")

</div>

Hello all, I am upgrading an older app from rails 1.2.3 to rails 2.0.2 and am upgrading rspec and rspec-on-rails to 1.1.3 in the process. After upgrading I am getting some weird errors relating to fixtures. Most of t…

---

## [Spec'ing controller macros](https://www.ruby-forum.com/t/specing-controller-macros/136192)

<div class="topic-metadata">

**Author:** [@Matt\_McNeil](https://www.ruby-forum.com/u/Matt_McNeil)\
**Replies:** 1\
**Last updated:** [April 29, 2008, 7:13pm UTC](https://www.ruby-forum.com/t/specing-controller-macros/136192 "2008-04-29T19:13:10Z")

</div>

Hi, (This is my first post after months of appreciative lurking…) I’m trying to spec the following conditional controller macro: class ApplicationController \< ActionController::Base turn off session management for r…

---

## [Fixture Scenarios plugin](https://www.ruby-forum.com/t/fixture-scenarios-plugin/136195)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 0\
**Last updated:** [April 29, 2008, 7:07pm UTC](https://www.ruby-forum.com/t/fixture-scenarios-plugin/136195 "2008-04-29T19:07:10Z")

</div>

Just curious if anything special needs to be done to use the Rails fixture scenarios plugin(http://code.google.com/p/fixture-scenarios/) with rspec? Would I just create the “scenarios” inside the spec/fixtures dir, as…

---

## [Noob question for getting true or false from a function](https://www.ruby-forum.com/t/noob-question-for-getting-true-or-false-from-a-function/136128)

<div class="topic-metadata">

**Author:** [@patcito](https://www.ruby-forum.com/u/patcito)\
**Replies:** 3\
**Last updated:** [April 29, 2008, 5:59pm UTC](https://www.ruby-forum.com/t/noob-question-for-getting-true-or-false-from-a-function/136128 "2008-04-29T17:59:08Z")

</div>

Hey all, I have an action that looks like this: def create if using\_open\_id? open\_id\_authentication(params\[:openid\_url\]) else password\_authentication(params\[:email\], params\[:password\]) end end I have a spec that…

---

## [Mock expectation in before block](https://www.ruby-forum.com/t/mock-expectation-in-before-block/136157)

<div class="topic-metadata">

**Author:** [@gendag](https://www.ruby-forum.com/u/gendag)\
**Replies:** 2\
**Last updated:** [April 29, 2008, 3:49pm UTC](https://www.ruby-forum.com/t/mock-expectation-in-before-block/136157 "2008-04-29T15:49:14Z")

</div>

Hi all, consider a class Foo that send, in its constructor, some message to an object of class Bar: class Foo def initialize(bar) @bar = bar @bar.some\_message end … end Now, in order to test Foo, I’d like to de…

---

## [Story runner on restful\_authentication question](https://www.ruby-forum.com/t/story-runner-on-restful-authentication-question/136068)

<div class="topic-metadata">

**Author:** [@sshingler](https://www.ruby-forum.com/u/sshingler)\
**Replies:** 8\
**Last updated:** [April 29, 2008, 2:36pm UTC](https://www.ruby-forum.com/t/story-runner-on-restful-authentication-question/136068 "2008-04-29T14:36:37Z")

</div>

Hi all, Have been following: http://www.tomtenthij.co.uk/2008/1/25/rspec-plain-text-story-runner-on-a-fresh-rails-app …as an introduction into the story runner. It shows how to get a couple of scenarios going to test…

---

## [Running spec\_server](https://www.ruby-forum.com/t/running-spec-server/135879)

<div class="topic-metadata">

**Author:** [@reivilo](https://www.ruby-forum.com/u/reivilo)\
**Replies:** 3\
**Last updated:** [April 28, 2008, 5:43pm UTC](https://www.ruby-forum.com/t/running-spec-server/135879 "2008-04-28T17:43:14Z")

</div>

Hello, I’ve been using rspec for a while now and just noticed spec\_server. I would like to use it, but for some reason, it’s not able to start. I have the latest versions of rspec and rspec\_on\_rails. I’m using Win…

---

## [Article on template for stories](https://www.ruby-forum.com/t/article-on-template-for-stories/136052)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [April 28, 2008, 2:40pm UTC](https://www.ruby-forum.com/t/article-on-template-for-stories/136052 "2008-04-28T14:40:00Z")

</div>

Mike Cohn just wrote a nice post justifying what has become the preferred template for stories in BDD: As a \[ role \] I want \[ feature \] So that \[ benefit \]

---

## [Rspec output and unicode](https://www.ruby-forum.com/t/rspec-output-and-unicode/135844)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 2\
**Last updated:** [April 27, 2008, 2:24am UTC](https://www.ruby-forum.com/t/rspec-output-and-unicode/135844 "2008-04-27T02:24:09Z")

</div>

Hey there, Rspec output (1.1.3) doesn’t seem to be handling unicode characters correctly. I’m expecting to see Japanese katakana (on winXP) and I’m getting numbers instead - the byte representation of the katakana or …

---

## [Restful controllers with different content types](https://www.ruby-forum.com/t/restful-controllers-with-different-content-types/135908)

<div class="topic-metadata">

**Author:** [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Replies:** 2\
**Last updated:** [April 27, 2008, 12:38am UTC](https://www.ruby-forum.com/t/restful-controllers-with-different-content-types/135908 "2008-04-27T00:38:17Z")

</div>

Simplified example of a controller which takes a POST with a non-xml and non-form-urlencoded content type: class PhotosController \< ApplicationController def create Photo.create :binary\_data =\> request.body.read, :co…

---

## [Error testing rails controller](https://www.ruby-forum.com/t/error-testing-rails-controller/134068)

<div class="topic-metadata">

**Author:** [@jacob](https://www.ruby-forum.com/u/jacob)\
**Replies:** 2\
**Last updated:** [April 26, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/error-testing-rails-controller/134068 "2008-04-26T20:40:05Z")

</div>

I am trying to test my controllers with RSpec and from the examples I have found it is as easy as this: describe SessionsController do it “should render login template” do get ‘new’ response.should render\_template(:…

---

## [Spec the Application Controller application.rb](https://www.ruby-forum.com/t/spec-the-application-controller-application-rb/135372)

<div class="topic-metadata">

**Author:** [@andy](https://www.ruby-forum.com/u/andy)\
**Replies:** 6\
**Last updated:** [April 25, 2008, 10:26pm UTC](https://www.ruby-forum.com/t/spec-the-application-controller-application-rb/135372 "2008-04-25T22:26:06Z")

</div>

How would I go about writing specs for methods in the Application Controller: I’m thinking of simple methods that do authentication, through before filters or for example how might I spec this method in an applicatio…

---

## [Spec migrations?](https://www.ruby-forum.com/t/spec-migrations/135840)

<div class="topic-metadata">

**Author:** [@Harm\_Aarts](https://www.ruby-forum.com/u/Harm_Aarts)\
**Replies:** 0\
**Last updated:** [April 25, 2008, 3:17pm UTC](https://www.ruby-forum.com/t/spec-migrations/135840 "2008-04-25T15:17:50Z")

</div>

Dear list, I am in the process of writing on an app with is already running. I need to create a couple of structural database changes for which I use migrations. However I want to be absolutely sure I do not destroy a…

---

## [Net:SSH](https://www.ruby-forum.com/t/net-ssh/135821)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 1\
**Last updated:** [April 25, 2008, 2:55pm UTC](https://www.ruby-forum.com/t/net-ssh/135821 "2008-04-25T14:55:22Z")

</div>

Guys I’m having a problem with net-ssh, its kinda taking too long to execute a command and give me the results. It takes around 40 seonds to do it. And I have 3-4 commands to run on the remote box. Is there any possi…

---

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

<div class="topic-metadata">

**Author:** [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Replies:** 0\
**Last updated:** [April 24, 2008, 11:13am UTC](https://www.ruby-forum.com/t/no-subject/135702 "2008-04-24T11:13:01Z")

</div>

James McCarthy http://thewerks.org.uk

---

## [JRuby, RSpec, rcov](https://www.ruby-forum.com/t/jruby-rspec-rcov/135364)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [April 24, 2008, 10:24am UTC](https://www.ruby-forum.com/t/jruby-rspec-rcov/135364 "2008-04-24T10:24:37Z")

</div>

Do you guys know of any working version combination of JRuby, RSpec and rcov? Doesn’t look like rcov 0.8.1.2, RSpec 1.1.3, JRuby 1.1 is one of them.

---

## [How do i remove duplication from my steps in story runner?](https://www.ruby-forum.com/t/how-do-i-remove-duplication-from-my-steps-in-story-runner/135472)

<div class="topic-metadata">

**Author:** [@Perryn\_F](https://www.ruby-forum.com/u/Perryn_F)\
**Replies:** 5\
**Last updated:** [April 24, 2008, 6:40am UTC](https://www.ruby-forum.com/t/how-do-i-remove-duplication-from-my-steps-in-story-runner/135472 "2008-04-24T06:40:56Z")

</div>

OK, I’m probably being incredibly dense here I have some steps defined something like this (extremely contrived) example steps\_for(:foo) do #snip Given and When steps Then(“two nested divs and a image will be displa…

---

## [Mocking Net::SSH connections](https://www.ruby-forum.com/t/mocking-net-ssh-connections/135323)

<div class="topic-metadata">

**Author:** [@Jamie\_D](https://www.ruby-forum.com/u/Jamie_D)\
**Replies:** 5\
**Last updated:** [April 22, 2008, 1:35am UTC](https://www.ruby-forum.com/t/mocking-net-ssh-connections/135323 "2008-04-22T01:35:11Z")

</div>

Hi, So I’m stuck again with creating a mock for Net::SSH, I’ve managed to mock the call to Net::SSH.start and yield the Net::SSH mock but I am totally stuck with mocking the session.shell.sync call and will also need…

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

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