[rspec-users] Cucumber Scaffolds

James B. Byrne byrnejb at harte-lyne.ca
Wed Nov 12 12:27:42 EST 2008


On: Wed, 12 Nov 2008 17:35:40 +0100, "aslak hellesoy"
<aslak.hellesoy at gmail.com> wrote
>
> Do you have vendor/plugins/webrat ?
> If you have webrat as a gem you must require 'webrat' in env.rb
>
> Maybe the generated env.rb should have:
> require 'webrat' if !defined?(Webrat)
>

Yes.  That worked fine.  Now I have another question.  Please be patient
with me.

The features test now shows this:

$ rake features
(in /home/byrnejb/Software/Development/Projects/proforma.git)
Feature: Manage entities  # features/manage_entities.feature
  In order to keep track of entities
  A entity maintainer
  Should be able to manage multiple entities
  To Protect Revenue
  Scenario: Register a new entity                                      #
features/manage_entities.feature:7
    Given I am on the new entity page                                  #
features/steps/entity_steps.rb:1
      wrong number of arguments (3 for 1) (ActionView::TemplateError)
      On line #10 of app/views/entities/new.html.erb

      7: <% form_for(@entity) do |f| %>
      8:
      9:   <%= render  :partial  => 'entities/entity_header',
      10:               :object   => @entity -%>
      11:
      12:   <p>
      13:   <%= f.submit "Create" -%>

      vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb:13:in
`render_partial'
      vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb:13:in
`render_partial'

I am obviously retro-fitting tests on code that I have already written. 
In this instance I have extracted code common to the new and the edit
views into a partial.  What is this test error telling me and how do I get
my feature/step to accommodate my existing ( and working ) code?

# steps/entity_steps.rb
Given /I am on the new entity page/ do
  visits "/entities/new"
end

Regards,

-- 
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3



More information about the rspec-users mailing list