[rspec-users] RailsStory runner - empty response

Pat Maddox pergesu at gmail.com
Tue Oct 16 14:09:45 EDT 2007


On 10/16/07, Alvin Schur <a.schur at nucleus.com> wrote:
> Alvin Schur wrote:
> >
> >> On 10/16/07, Alvin Schur <a.schur at nucleus.com> wrote:
> >>
> >>> I generated a new rails app then installed rspec and rspec_on_rails
> >>> from
> >>> trunk.
> >>>
> >>> I then created a sample story:
> >>>
> >>> require File.dirname(__FILE__) + "/helper"
> >>>
> >>> Story "View Home Page", %{
> >>>   As a user
> >>>   I want to view my home page
> >>>   So that I can get a birds eye view of the system
> >>> }, :type => RailsStory do
> >>>
> >>>   Scenario "Publisher with no videos" do
> >>>
> >>>     When "visiting", "/" do |page|
> >>>       get page
> >>>     end
> >>>
> >>>     Then "viewer should see", "companies/show_initial" do |template|
> >>>       response.should have_text(/Welcome/)
> >>>     end
> >>>   end
> >>>
> >>> end
> >>>
> >>> When I run the story, I get the error:
> >>>
> >> <snip ...>
> >>
> >>
> >>> FAILURES:
> >>>   1) View Home Page (Publisher with no videos) FAILED
> >>>   Spec::Expectations::ExpectationNotMetError: expected /Welcome/,
> >>> got ""
> >>>
> >>
> >> <snip ...>
> >>
> >>
> >>> I was expecting to see the default rails index page in the response.
> >>>
> >>> Where am I going wrong?
> >>>
> >>
> >> Do you see the rails index page when you run the app?
> >>
> >>
> >
> > Yes.
> >
> >
> >
> I created a basic rails integration test for the default welcome page
> (public/index.html) and this failed as well: no route found for /   or
> page not found errors.
>
> I added a basic controller:
>
> class WelcomeController < ApplicationController
>
>   def index
>     render :text => "Welcome alvin"
>   end
> end
>
>
> The rails integration test works as expected with the welcome controller.
>
> The RailsStory works as expected with the welcome controller.
>
> Alvin.
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>

Funky.  I guess integration tests are going only through the routing
and don't serve up any plain HTML pages at all.

Pat


More information about the rspec-users mailing list