cavalle / steak

DISCONTINUED - The delicious combination of RSpec and Capybara for Acceptance BDD
MIT License
763 stars 32 forks source link

Nested "features" raise error. #27

Closed milkcocoa closed 13 years ago

milkcocoa commented 13 years ago

After I updated Steak rc.1 to 1.0.0, my specs which uses nested feature like following raise error.

require File.expand_path(File.dirname(__FILE__) + '/../acceptance_helper')

feature "Users", %q{
  In order to ...
  As a ...
  I want to ...
} do

  background do
    setup_driver
  end

  feature "foo" do
    background do
      setup_user
    end

    scenario "bar" do
      true.should == true
    end
  end
end

Have nested features become not to be accepted?

Error is here.

RAILS_ROOT/spec/acceptance/api/users_spec.rb:13:in `block in ': undefined method `feature' for # (NoMethodError)

My environment is following.

cavalle commented 13 years ago

Hi. If nested features used to work it should be a weird side effects, since features are not meant to be nested. For your use case I suggest you use context instead of the inner feature.