mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
More explicit test for CSS selectors being scoped
This commit is contained in:
parent
06e030b624
commit
02bf763370
1 changed files with 14 additions and 8 deletions
|
@ -9,14 +9,20 @@ shared_examples_for "find" do
|
||||||
@session.find("//input[@id='test_field']")[:value].should == 'monkey'
|
@session.find("//input[@id='test_field']")[:value].should == 'monkey'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should act return a session like object" do
|
describe 'the returned node' do
|
||||||
@session.visit('/form')
|
it "should act like a session object" do
|
||||||
@form = @session.find(:css, '#get-form')
|
@session.visit('/form')
|
||||||
@form.should have_field('Middle Name')
|
@form = @session.find(:css, '#get-form')
|
||||||
@form.should have_no_field('Languages')
|
@form.should have_field('Middle Name')
|
||||||
@form.fill_in('Middle Name', :with => 'Monkey')
|
@form.should have_no_field('Languages')
|
||||||
@form.click_button('med')
|
@form.fill_in('Middle Name', :with => 'Monkey')
|
||||||
extract_results(@session)['middle_name'].should == 'Monkey'
|
@form.click_button('med')
|
||||||
|
extract_results(@session)['middle_name'].should == 'Monkey'
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should scope CSS selectors" do
|
||||||
|
@session.find(:css, '#second').should have_no_css('h1')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with css selectors" do
|
context "with css selectors" do
|
||||||
|
|
Loading…
Reference in a new issue