teamcapybara--capybara/spec/drivers_spec.rb

26 lines
620 B
Ruby
Raw Normal View History

2009-11-04 22:00:05 +00:00
require File.expand_path('spec_helper', File.dirname(__FILE__))
shared_examples_for 'driver' do
2009-11-04 22:32:35 +00:00
describe '#visit' do
it "should move to another page" do
2009-11-04 22:05:11 +00:00
@driver.visit('/')
2009-11-04 22:00:05 +00:00
@driver.body.should == 'Hello world!'
2009-11-04 22:05:11 +00:00
@driver.visit('/foo')
2009-11-04 22:00:05 +00:00
@driver.body.should == 'Another World'
end
end
2009-11-04 22:32:35 +00:00
describe '#body' do
it "should return text reponses" do
@driver.visit('/')
@driver.body.should == 'Hello world!'
end
it "should return the full response html" do
@driver.visit('/with_simple_html')
@driver.body.should == '<h1>Bar</h1>'
end
end
2009-11-04 22:00:05 +00:00
end