mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Merge pull request #1113 from tgaff/tg/nested_features
Permit nested features
This commit is contained in:
commit
61524b0fd3
2 changed files with 17 additions and 0 deletions
|
@ -7,11 +7,13 @@ module Capybara
|
|||
alias :xscenario :xit
|
||||
alias :given :let
|
||||
alias :given! :let!
|
||||
alias :feature :describe
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def self.feature(*args, &block)
|
||||
options = if args.last.is_a?(Hash) then args.pop else {} end
|
||||
options[:capybara_feature] = true
|
||||
|
|
|
@ -34,6 +34,21 @@ feature "Capybara's feature DSL" do
|
|||
scenario "doesn't pollute the Object namespace" do
|
||||
Object.new.respond_to?(:feature, true).should be_false
|
||||
end
|
||||
|
||||
feature 'nested features' do
|
||||
scenario 'work as expected' do
|
||||
visit '/'
|
||||
page.should have_content 'Hello world!'
|
||||
end
|
||||
|
||||
scenario 'are marked in the metadata as capybara_feature' do
|
||||
example.metadata[:capybara_feature].should be_true
|
||||
end
|
||||
|
||||
scenario 'have a type of :feature' do
|
||||
example.metadata[:type].should eq :feature
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
feature "given and given! aliases to let and let!" do
|
||||
|
|
Loading…
Reference in a new issue