Forum: RSpec [Cucumber] Bug with background

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andrew P. (Guest)
on 2009-03-30 14:29
(Received via mailing list)
Seem to be getting a problem when running a feature with background.
Running
the whole file works fine however running an individual feature fails.
The
background steps are

Background:
  Given an admin user Philip exists
  When I login as Philip
  Then I should be logged in as Philip


running the following scenario on its own causes an error

Scenario: Admin should be able to run a feed #
features/admin/manage_feeds.feature:23
    Given an admin user Philip exists    #
features/step_definitions/accounts/creation.steps.rb:66
      Validation failed: Login has already been taken, Email has already
been taken (ActiveRecord::RecordInvalid)

/Users/andy/Sites/mvor/vendor/plugins/object_daddy/lib/object_daddy.rb:210:in
`generate!'

/Users/andy/Sites/mvor/vendor/plugins/object_daddy/lib/object_daddy.rb:32:in
`spawn'

/Users/andy/Sites/mvor/vendor/plugins/object_daddy/lib/object_daddy.rb:209:in
`/^I create a user with login (\w*)$/'
      features/admin/manage_feeds.feature:7:in `Given an admin user
Philip
exists'
    Given there is 1 valid feed                #
features/step_definitions/admin/admin_supplier_feed.steps.rb:8

Now this only happens if there is at least one scenario in the file
before
the tested scenario, so I'm speculating that when you run a feature
using
'cucumber path/to/feature/feature:xx -r path/to/steps, then background
is
not doing is

1) Running for preceding scenarios
2) Not clearing the database for a scenario run by line number

Wondering if anyone else can replicate this, or has any ideas about it
before I put this in lighthouse.

Cheers

Andrew
Aslak H. (Guest)
on 2009-03-30 15:17
(Received via mailing list)
2009/3/30 Andrew P. <removed_email_address@domain.invalid>

> running the following scenario on its own causes an error
>
> Now this only happens if there is at least one scenario in the file before
> the tested scenario, so I'm speculating that when you run a feature using
> 'cucumber path/to/feature/feature:xx -r path/to/steps, then background is
> not doing is
>
> 1) Running for preceding scenarios
> 2) Not clearing the database for a scenario run by line number
>
> Wondering if anyone else can replicate this, or has any ideas about it
> before I put this in lighthouse.
>

Sounds like a bug. It would be wonderful if you could also provide some
files for us to put under examples/tickets/features to reproduce it. See
examples/tickets/features/246.feature for an example.

Cheers,
Aslak
Andrew P. (Guest)
on 2009-03-31 13:46
(Received via mailing list)
Submitted bug :
https://rspec.lighthouseapp.com/projects/16211-cuc...

Put some features and output in a gist that show this bug, hope its
sufficient.

All best

Andrew

2009/3/30 aslak hellesoy <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.