form_robot 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ea4ac7421fef20c37012cf90328353eed4a53ef
4
- data.tar.gz: 05eac10f718a809aece04b8ec885a9c313cd84b2
3
+ metadata.gz: 31bee54546f4b5e857693c61fe336fe1fa6f478f
4
+ data.tar.gz: 87af9b8860f8c764570e7b1fffaf3fdb9027664f
5
5
  SHA512:
6
- metadata.gz: 5992f3cc0ff5dcb6e65be61ac29db182ae4da983b91cbbd76c0b60661d08275db1b6d5213da44f6b561c31102760849832bf1844d8d68d644f835c961e689da2
7
- data.tar.gz: f19f7ed1f65ba2590dc4740a45c96b0a1ca208056ff8b10eb9fbd770cd8892fae1c775c40f91f42cd5179e78945ffe0321d16a3cf1dac4eb6f55c480a086fae5
6
+ metadata.gz: 25f760bdf6dfd4d1def35b27d88c26f2179c8adece29b0d50c4d3a1a4b326e21fd56ac9f0f1069b3630bffbb1f176549340cffbadc2a155cd22036ceca053424
7
+ data.tar.gz: f72b3754c6cc93a39e9bc5376883ad3996efa2213d89694e37db79423767a6a5fcf6cf5f8066fc93982b57e76d3a760f1becd05997c62329dd14c71ba569f211
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.3
4
+
5
+ Make sure that the robot's response is in UTF-8
6
+
3
7
  ## 0.0.2
4
8
 
5
9
  Set the User Agent to Mac Safari
@@ -18,7 +18,7 @@ class Robot
18
18
  end
19
19
 
20
20
  def last_response
21
- @mech.page.header.to_s + @mech.page.body
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
- look_for_text ? @mech.page.body.match(look_for_text) : true
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
@@ -1,3 +1,3 @@
1
1
  module FormRobot
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -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.2
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