webrat 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +37 -0
- data/MIT-LICENSE.txt +19 -0
- data/Manifest.txt +20 -0
- data/README.txt +86 -0
- data/Rakefile +27 -0
- data/TODO.txt +4 -0
- data/init.rb +3 -0
- data/install.rb +1 -0
- data/lib/webrat.rb +6 -0
- data/lib/webrat/rails_extensions.rb +27 -0
- data/lib/webrat/session.rb +523 -0
- data/test/checks_test.rb +121 -0
- data/test/chooses_test.rb +74 -0
- data/test/clicks_button_test.rb +308 -0
- data/test/clicks_link_test.rb +193 -0
- data/test/fills_in_test.rb +139 -0
- data/test/helper.rb +21 -0
- data/test/reloads_test.rb +26 -0
- data/test/selects_test.rb +93 -0
- data/test/visits_test.rb +31 -0
- metadata +104 -0
data/test/visits_test.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.dirname(__FILE__) + "/helper"
|
2
|
+
|
3
|
+
RAILS_ROOT = "." unless defined?(RAILS_ROOT)
|
4
|
+
|
5
|
+
class VisitsTest < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@session = ActionController::Integration::Session.new
|
9
|
+
@session.stubs(:assert_response)
|
10
|
+
@session.stubs(:get_via_redirect)
|
11
|
+
@response = mock
|
12
|
+
@session.stubs(:response).returns(@response)
|
13
|
+
@response.stubs(:body).returns("")
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_should_use_get
|
17
|
+
@session.expects(:get_via_redirect).with("/", {})
|
18
|
+
@session.visits("/")
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_should_assert_valid_response
|
22
|
+
@session.expects(:assert_response).with(:success)
|
23
|
+
@session.visits("/")
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_should_require_a_visit_before_manipulating_page
|
27
|
+
assert_raise(RuntimeError) do
|
28
|
+
@session.fills_in "foo", :with => "blah"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: webrat
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bryan Helmkamp
|
8
|
+
- Seth Fitzsimmons
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2008-04-04 00:00:00 +01:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: hpricot
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0.6"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: hoe
|
27
|
+
version_requirement:
|
28
|
+
version_requirements: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.5.1
|
33
|
+
version:
|
34
|
+
description: Webrat lets you quickly write robust and thorough acceptance tests for a Ruby web application. By leveraging the DOM, it can run tests similarly to an in-browser testing solution without the associated performance hit (and browser dependency). The result is tests that are less fragile and more effective at verifying that the app will respond properly to users. When comparing Webrat with an in-browser testing solution like Watir or Selenium, the primary consideration should be how much JavaScript the application uses. In-browser testing is currently the only way to test JS, and that may make it a requirement for your project. If JavaScript is not central to your application, Webrat is a simpler, effective solution that will let you run your tests much faster and more frequently. (Benchmarks forthcoming.) Initial development was sponsored by EastMedia (http://www.eastmedia.com).
|
35
|
+
email:
|
36
|
+
- bryan@brynary.com
|
37
|
+
- seth@mojodna.net
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files:
|
43
|
+
- History.txt
|
44
|
+
- MIT-LICENSE.txt
|
45
|
+
- Manifest.txt
|
46
|
+
- README.txt
|
47
|
+
- TODO.txt
|
48
|
+
files:
|
49
|
+
- History.txt
|
50
|
+
- MIT-LICENSE.txt
|
51
|
+
- Manifest.txt
|
52
|
+
- README.txt
|
53
|
+
- Rakefile
|
54
|
+
- TODO.txt
|
55
|
+
- init.rb
|
56
|
+
- install.rb
|
57
|
+
- lib/webrat.rb
|
58
|
+
- lib/webrat/rails_extensions.rb
|
59
|
+
- lib/webrat/session.rb
|
60
|
+
- test/checks_test.rb
|
61
|
+
- test/chooses_test.rb
|
62
|
+
- test/clicks_button_test.rb
|
63
|
+
- test/clicks_link_test.rb
|
64
|
+
- test/fills_in_test.rb
|
65
|
+
- test/helper.rb
|
66
|
+
- test/reloads_test.rb
|
67
|
+
- test/selects_test.rb
|
68
|
+
- test/visits_test.rb
|
69
|
+
has_rdoc: true
|
70
|
+
homepage: http://rubyforge.org/projects/webrat
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options:
|
73
|
+
- --main
|
74
|
+
- README.txt
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: "0"
|
82
|
+
version:
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: "0"
|
88
|
+
version:
|
89
|
+
requirements: []
|
90
|
+
|
91
|
+
rubyforge_project: webrat
|
92
|
+
rubygems_version: 1.0.1
|
93
|
+
signing_key:
|
94
|
+
specification_version: 2
|
95
|
+
summary: Ruby Acceptance Testing for Web applications
|
96
|
+
test_files:
|
97
|
+
- test/checks_test.rb
|
98
|
+
- test/chooses_test.rb
|
99
|
+
- test/clicks_button_test.rb
|
100
|
+
- test/clicks_link_test.rb
|
101
|
+
- test/fills_in_test.rb
|
102
|
+
- test/reloads_test.rb
|
103
|
+
- test/selects_test.rb
|
104
|
+
- test/visits_test.rb
|