form_robot 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/form_robot/robot.rb +3 -2
- data/lib/form_robot/version.rb +1 -1
- data/test/lib/form_robot/encoding_test.rb +16 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31bee54546f4b5e857693c61fe336fe1fa6f478f
|
4
|
+
data.tar.gz: 87af9b8860f8c764570e7b1fffaf3fdb9027664f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25f760bdf6dfd4d1def35b27d88c26f2179c8adece29b0d50c4d3a1a4b326e21fd56ac9f0f1069b3630bffbb1f176549340cffbadc2a155cd22036ceca053424
|
7
|
+
data.tar.gz: f72b3754c6cc93a39e9bc5376883ad3996efa2213d89694e37db79423767a6a5fcf6cf5f8066fc93982b57e76d3a760f1becd05997c62329dd14c71ba569f211
|
data/CHANGELOG.md
CHANGED
data/lib/form_robot/robot.rb
CHANGED
@@ -18,7 +18,7 @@ class Robot
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def last_response
|
21
|
-
@mech.page.header.to_s + @mech.page.
|
21
|
+
@mech.page.header.to_s + @mech.page.parser.to_s
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
@@ -31,6 +31,7 @@ class Robot
|
|
31
31
|
form_with_params.set_fields( enter_params )
|
32
32
|
form_with_params.submit
|
33
33
|
|
34
|
-
|
34
|
+
@mech.page.encoding = 'utf-8'
|
35
|
+
look_for_text ? @mech.page.parser.to_s.match(look_for_text) : true
|
35
36
|
end
|
36
37
|
end
|
data/lib/form_robot/version.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
require_relative '../../test_helper'
|
2
|
+
|
3
|
+
describe Robot do
|
4
|
+
robot = Robot.new
|
5
|
+
|
6
|
+
it 'must give a UTF-8 response' do
|
7
|
+
instructions = {
|
8
|
+
go_to_url: 'http://www.google.com',
|
9
|
+
enter_params: {
|
10
|
+
'q' => 'broughton',
|
11
|
+
},
|
12
|
+
};
|
13
|
+
robot.carry_out(instructions)
|
14
|
+
assert_equal robot.last_response.encoding.name, 'UTF-8'
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: form_robot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keith Broughton
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/form_robot.rb
|
71
71
|
- lib/form_robot/robot.rb
|
72
72
|
- lib/form_robot/version.rb
|
73
|
+
- test/lib/form_robot/encoding_test.rb
|
73
74
|
- test/lib/form_robot/robot_test.rb
|
74
75
|
- test/lib/form_robot/version_test.rb
|
75
76
|
- test/test_helper.rb
|
@@ -99,6 +100,7 @@ specification_version: 4
|
|
99
100
|
summary: The Form Robot gem accepts a list of instructions to perform against a collection
|
100
101
|
of URLs and HTML forms.
|
101
102
|
test_files:
|
103
|
+
- test/lib/form_robot/encoding_test.rb
|
102
104
|
- test/lib/form_robot/robot_test.rb
|
103
105
|
- test/lib/form_robot/version_test.rb
|
104
106
|
- test/test_helper.rb
|