capybara 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +11 -1
- data/lib/capybara/rack_test/node.rb +4 -1
- data/lib/capybara/selenium/node.rb +3 -3
- data/lib/capybara/spec/session/select_spec.rb +8 -0
- data/lib/capybara/spec/views/form.erb +1 -1
- data/lib/capybara/util/save_and_open_page.rb +1 -1
- data/lib/capybara/version.rb +1 -1
- data/spec/save_and_open_page_spec.rb +1 -1
- metadata +8 -9
data/History.txt
CHANGED
@@ -1,6 +1,16 @@
|
|
1
|
+
# Version 1.0.1
|
2
|
+
|
3
|
+
Release date: 2011-08-12
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
* Dependend on selenium-webdriver ~>2.0 and fix deprecations [Thomas Walpole, Jo Liss]
|
8
|
+
* Depend on Launch 2.0 [Jeremy Hinegardner]
|
9
|
+
* Rack-Test ignores fill in on fields with maxlength=""
|
10
|
+
|
1
11
|
# Version 1.0.0
|
2
12
|
|
3
|
-
Release date:
|
13
|
+
Release date: 2011-06-14
|
4
14
|
|
5
15
|
### Added
|
6
16
|
|
@@ -23,7 +23,10 @@ class Capybara::RackTest::Node < Capybara::Driver::Node
|
|
23
23
|
native.remove_attribute('checked')
|
24
24
|
end
|
25
25
|
elsif tag_name == 'input'
|
26
|
-
if (type == 'text' || type == 'password') && self[:maxlength]
|
26
|
+
if (type == 'text' || type == 'password') && self[:maxlength] &&
|
27
|
+
!self[:maxlength].empty?
|
28
|
+
# Browser behavior for maxlength="0" is inconsistent, so we stick with
|
29
|
+
# Firefox, allowing no input
|
27
30
|
value = value[0...self[:maxlength].to_i]
|
28
31
|
end
|
29
32
|
native['value'] = value.to_s
|
@@ -31,14 +31,14 @@ class Capybara::Selenium::Node < Capybara::Driver::Node
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def select_option
|
34
|
-
resynchronize { native.
|
34
|
+
resynchronize { native.click } unless selected?
|
35
35
|
end
|
36
36
|
|
37
37
|
def unselect_option
|
38
38
|
if select_node['multiple'] != 'multiple' and select_node['multiple'] != 'true'
|
39
39
|
raise Capybara::UnselectNotAllowed, "Cannot unselect option from single select box."
|
40
40
|
end
|
41
|
-
resynchronize { native.
|
41
|
+
resynchronize { native.click } if selected?
|
42
42
|
end
|
43
43
|
|
44
44
|
def click
|
@@ -46,7 +46,7 @@ class Capybara::Selenium::Node < Capybara::Driver::Node
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def drag_to(element)
|
49
|
-
resynchronize {
|
49
|
+
resynchronize { driver.browser.action.drag_and_drop(native, element.native).perform }
|
50
50
|
end
|
51
51
|
|
52
52
|
def tag_name
|
@@ -97,6 +97,14 @@ shared_examples_for "select" do
|
|
97
97
|
extract_results(@session)['languages'].should include('Ruby', 'Javascript')
|
98
98
|
end
|
99
99
|
|
100
|
+
it "should remain selected if already selected" do
|
101
|
+
@session.select("Ruby", :from => 'Language')
|
102
|
+
@session.select("Javascript", :from => 'Language')
|
103
|
+
@session.select("Ruby", :from => 'Language')
|
104
|
+
@session.click_button('awesome')
|
105
|
+
extract_results(@session)['languages'].should include('Ruby', 'Javascript')
|
106
|
+
end
|
107
|
+
|
100
108
|
it "should return value attribute rather than content if present" do
|
101
109
|
@session.find_field('Underwear').value.should include('thermal')
|
102
110
|
end
|
@@ -23,7 +23,7 @@ module Capybara
|
|
23
23
|
|
24
24
|
def open_in_browser(path) # :nodoc
|
25
25
|
require "launchy"
|
26
|
-
Launchy
|
26
|
+
Launchy.open(path)
|
27
27
|
rescue LoadError
|
28
28
|
warn "Sorry, you need to install launchy (`gem install launchy`) and " <<
|
29
29
|
"make sure it's available to open pages with `save_and_open_page`."
|
data/lib/capybara/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 1
|
9
|
+
version: 1.0.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jonas Nicklas
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-08-12 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -55,10 +55,9 @@ dependencies:
|
|
55
55
|
- - ~>
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
segments:
|
58
|
-
- 0
|
59
58
|
- 2
|
60
59
|
- 0
|
61
|
-
version:
|
60
|
+
version: "2.0"
|
62
61
|
type: :runtime
|
63
62
|
version_requirements: *id003
|
64
63
|
- !ruby/object:Gem::Dependency
|
@@ -142,13 +141,13 @@ dependencies:
|
|
142
141
|
requirement: &id009 !ruby/object:Gem::Requirement
|
143
142
|
none: false
|
144
143
|
requirements:
|
145
|
-
- -
|
144
|
+
- - ~>
|
146
145
|
- !ruby/object:Gem::Version
|
147
146
|
segments:
|
147
|
+
- 2
|
148
148
|
- 0
|
149
|
-
-
|
150
|
-
|
151
|
-
version: 0.3.5
|
149
|
+
- 2
|
150
|
+
version: 2.0.2
|
152
151
|
type: :development
|
153
152
|
version_requirements: *id009
|
154
153
|
- !ruby/object:Gem::Dependency
|