cucumber-wordpress 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/examples/features/step_definitions/webrat_steps.rb +2 -0
- data/examples/features/support/env.rb +2 -0
- data/examples/features/support/paths.rb +2 -0
- data/lib/cucumber-wordpress.rb +2 -0
- data/lib/cucumber-wordpress/path_to.rb +2 -0
- data/lib/cucumber-wordpress/steps.rb +2 -0
- data/lib/cucumber-wordpress/steps/given.rb +8 -2
- data/lib/cucumber-wordpress/steps/should.rb +2 -0
- data/lib/cucumber-wordpress/webrat-patches.rb +12 -4
- metadata +14 -9
- data/.gitignore +0 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.1
|
data/lib/cucumber-wordpress.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
Given /^WordPress is installed$/ do
|
2
4
|
visit path_to 'homepage'
|
3
5
|
title = 'A Very Boring Test Title'
|
@@ -78,7 +80,7 @@ end
|
|
78
80
|
Given /^plugin "([^\"]*)" is (enabled|disabled)$/ do |plugin,able|
|
79
81
|
Given 'I am logged in as "admin"'
|
80
82
|
Given 'I am on plugins'
|
81
|
-
link = %Q&//a[contains(@href,"
|
83
|
+
link = %Q&//a[contains(@href,"plugin=#{plugin}%2F")]&
|
82
84
|
if able == 'enabled'
|
83
85
|
text = 'Activate'
|
84
86
|
else
|
@@ -129,7 +131,11 @@ Given /^there is a user "([^"]*)" with role "([^"]*)"$/ do |username, role|
|
|
129
131
|
fill_in 'pass1', :with => password
|
130
132
|
fill_in 'pass2', :with => password
|
131
133
|
select role.capitalize, :from => 'role'
|
132
|
-
|
134
|
+
begin
|
135
|
+
click_button 'Add New User' # 3.1
|
136
|
+
rescue Webrat::NotFoundError
|
137
|
+
click_button 'Add User' # 3.0
|
138
|
+
end
|
133
139
|
|
134
140
|
WordPress.passwords.merge!({username => password})
|
135
141
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
#
|
2
4
|
# Let's fix a few bugs in Webrat!
|
3
5
|
#
|
@@ -6,11 +8,17 @@
|
|
6
8
|
# This is needed
|
7
9
|
module Webrat
|
8
10
|
class Session
|
9
|
-
|
11
|
+
class MockBody
|
12
|
+
def initialize response_body
|
13
|
+
@response_body = response_body
|
14
|
+
end
|
15
|
+
def body
|
16
|
+
@response_body
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
10
20
|
def response
|
11
|
-
|
12
|
-
m.should_receive(:body).any_number_of_times.and_return(response_body)
|
13
|
-
m
|
21
|
+
MockBody.new response_body
|
14
22
|
end
|
15
23
|
end
|
16
24
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 1.3.
|
8
|
+
- 1
|
9
|
+
version: 1.3.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Tom Adams
|
@@ -14,13 +14,14 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-03-17 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: cucumber
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
24
25
|
requirements:
|
25
26
|
- - ">="
|
26
27
|
- !ruby/object:Gem::Version
|
@@ -33,6 +34,7 @@ dependencies:
|
|
33
34
|
name: webrat
|
34
35
|
prerelease: false
|
35
36
|
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
36
38
|
requirements:
|
37
39
|
- - ">="
|
38
40
|
- !ruby/object:Gem::Version
|
@@ -45,6 +47,7 @@ dependencies:
|
|
45
47
|
name: mechanize
|
46
48
|
prerelease: false
|
47
49
|
requirement: &id003 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
48
51
|
requirements:
|
49
52
|
- - ">="
|
50
53
|
- !ruby/object:Gem::Version
|
@@ -57,6 +60,7 @@ dependencies:
|
|
57
60
|
name: mysql
|
58
61
|
prerelease: false
|
59
62
|
requirement: &id004 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
60
64
|
requirements:
|
61
65
|
- - ">="
|
62
66
|
- !ruby/object:Gem::Version
|
@@ -74,7 +78,6 @@ extensions: []
|
|
74
78
|
extra_rdoc_files:
|
75
79
|
- README.rdoc
|
76
80
|
files:
|
77
|
-
- .gitignore
|
78
81
|
- LICENCE
|
79
82
|
- README.rdoc
|
80
83
|
- Rakefile
|
@@ -95,11 +98,12 @@ homepage: http://github.com/dxw/cucumber-wordpress
|
|
95
98
|
licenses: []
|
96
99
|
|
97
100
|
post_install_message:
|
98
|
-
rdoc_options:
|
99
|
-
|
101
|
+
rdoc_options: []
|
102
|
+
|
100
103
|
require_paths:
|
101
104
|
- lib
|
102
105
|
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
103
107
|
requirements:
|
104
108
|
- - ">="
|
105
109
|
- !ruby/object:Gem::Version
|
@@ -107,6 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
111
|
- 0
|
108
112
|
version: "0"
|
109
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
110
115
|
requirements:
|
111
116
|
- - ">="
|
112
117
|
- !ruby/object:Gem::Version
|
@@ -116,11 +121,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
121
|
requirements: []
|
117
122
|
|
118
123
|
rubyforge_project:
|
119
|
-
rubygems_version: 1.3.
|
124
|
+
rubygems_version: 1.3.7
|
120
125
|
signing_key:
|
121
126
|
specification_version: 3
|
122
127
|
summary: Environment setup and step definitions for testing WordPress with Cucumber
|
123
128
|
test_files:
|
124
|
-
- examples/features/support/paths.rb
|
125
|
-
- examples/features/support/env.rb
|
126
129
|
- examples/features/step_definitions/webrat_steps.rb
|
130
|
+
- examples/features/support/env.rb
|
131
|
+
- examples/features/support/paths.rb
|
data/.gitignore
DELETED