mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-12 23:46:15 +01:00
Added Rspec and Webrat plugins and started porting Selenium on Rails tests to Rspec Plain Text Stories driving Webrat driving Selenium.
This commit is contained in:
parent
7b432a74ed
commit
2c09db45c5
602 changed files with 47788 additions and 29 deletions
22
vendor/plugins/webrat/spec/api/visits_spec.rb
vendored
Normal file
22
vendor/plugins/webrat/spec/api/visits_spec.rb
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
||||
|
||||
describe "visits" do
|
||||
before do
|
||||
@session = Webrat::TestSession.new
|
||||
@session.response_body = "Hello world"
|
||||
end
|
||||
|
||||
it "should use get" do
|
||||
@session.expects(:get).with("/", {})
|
||||
@session.visits("/")
|
||||
end
|
||||
|
||||
it "should assert valid response" do
|
||||
@session.response_code = 404
|
||||
lambda { @session.visits("/") }.should raise_error
|
||||
end
|
||||
|
||||
it "should require a visit before manipulating page" do
|
||||
lambda { @session.fills_in "foo", :with => "blah" }.should raise_error
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue