mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
cf1aa4d073
This way, implementations of other drivers can use the specs to verify that they are working correctly.
32 lines
796 B
Ruby
32 lines
796 B
Ruby
shared_examples_for "has_button" do
|
|
describe '#has_button?' do
|
|
before do
|
|
@session.visit('/form')
|
|
end
|
|
|
|
it "should be true if the given button is on the page" do
|
|
@session.should have_button('med')
|
|
@session.should have_button('crap321')
|
|
end
|
|
|
|
it "should be false if the given button is not on the page" do
|
|
@session.should_not have_button('monkey')
|
|
end
|
|
end
|
|
|
|
describe '#has_no_button?' do
|
|
before do
|
|
@session.visit('/form')
|
|
end
|
|
|
|
it "should be true if the given button is on the page" do
|
|
@session.should_not have_no_button('med')
|
|
@session.should_not have_no_button('crap321')
|
|
end
|
|
|
|
it "should be false if the given button is not on the page" do
|
|
@session.should have_no_button('monkey')
|
|
end
|
|
end
|
|
end
|
|
|