dragonfly 0.9.12 → 0.9.13
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of dragonfly might be problematic. Click here for more details.
- data/Gemfile +7 -6
- data/History.md +6 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/dragonfly.gemspec +26 -68
- data/extra_docs/Rails3.md +1 -1
- data/features/no_processing.feature +1 -1
- data/fixtures/rails/files/app/models/album.rb +1 -0
- data/fixtures/rails/files/features/step_definitions/web_steps.rb +189 -0
- data/lib/dragonfly/active_model_extensions/class_methods.rb +15 -15
- data/lib/dragonfly/image_magick/generator.rb +2 -0
- data/lib/dragonfly/image_magick/processor.rb +26 -20
- data/lib/dragonfly/job.rb +24 -18
- data/lib/dragonfly/routed_endpoint.rb +1 -8
- data/lib/dragonfly/serializer.rb +20 -9
- data/lib/dragonfly/server.rb +5 -6
- data/lib/dragonfly/url_mapper.rb +11 -17
- data/lib/dragonfly/utils.rb +24 -0
- data/spec/dragonfly/active_model_extensions/model_spec.rb +60 -60
- data/spec/dragonfly/data_storage/s3_data_store_spec.rb +25 -25
- data/spec/dragonfly/image_magick/analyser_spec.rb +3 -8
- data/spec/dragonfly/image_magick/encoder_spec.rb +12 -7
- data/spec/dragonfly/image_magick/generator_spec.rb +18 -7
- data/spec/dragonfly/image_magick/processor_spec.rb +28 -28
- data/spec/dragonfly/job_endpoint_spec.rb +9 -9
- data/spec/dragonfly/job_spec.rb +54 -53
- data/spec/dragonfly/serializer_spec.rb +36 -20
- data/spec/dragonfly/server_spec.rb +23 -41
- data/spec/dragonfly/url_mapper_spec.rb +12 -3
- metadata +166 -98
data/Gemfile
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
source :rubygems
|
2
2
|
|
3
3
|
gem "rack"
|
4
|
+
gem "multi_json", "~> 1.0"
|
4
5
|
|
5
6
|
# These gems are needed for development and testing
|
6
7
|
group :development, :test, :cucumber do
|
7
8
|
gem 'capybara'
|
8
|
-
gem 'cucumber', '~>
|
9
|
-
gem 'cucumber-rails',
|
9
|
+
gem 'cucumber', '~>1.2.1'
|
10
|
+
gem 'cucumber-rails', "~> 1.3.0"
|
10
11
|
gem 'database_cleaner'
|
11
|
-
gem 'jeweler', '
|
12
|
+
gem 'jeweler', '>= 1.5.2'
|
12
13
|
gem 'fog'
|
13
14
|
gem 'github-markup'
|
14
15
|
gem 'mongo'
|
15
16
|
gem 'couchrest', '~> 1.0'
|
16
17
|
gem 'rack-cache'
|
17
|
-
gem 'rails', '~>3.
|
18
|
-
gem 'redcarpet', '~>1.0'
|
18
|
+
gem 'rails', '~>3.2.0', :require => nil
|
19
19
|
gem 'rspec', '~> 2.5'
|
20
20
|
gem 'webmock'
|
21
21
|
gem 'yard'
|
@@ -24,8 +24,9 @@ group :development, :test, :cucumber do
|
|
24
24
|
gem "activerecord-jdbcsqlite3-adapter"
|
25
25
|
gem "jruby-openssl"
|
26
26
|
else
|
27
|
+
gem 'redcarpet', '~>1.0'
|
27
28
|
gem 'bluecloth'
|
28
29
|
gem 'bson_ext'
|
29
|
-
gem 'sqlite3
|
30
|
+
gem 'sqlite3'
|
30
31
|
end
|
31
32
|
end
|
data/History.md
CHANGED
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.13
|
data/dragonfly.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "dragonfly"
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.13"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mark Evans"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2013-01-30"
|
13
13
|
s.description = "Dragonfly is a framework that enables on-the-fly processing for any content type.\n It is especially suited to image handling. Its uses range from image thumbnails to standard attachments to on-demand text generation."
|
14
14
|
s.email = "mark@new-bamboo.co.uk"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -65,6 +65,7 @@ Gem::Specification.new do |s|
|
|
65
65
|
"fixtures/rails/files/features/manage_album_images.feature",
|
66
66
|
"fixtures/rails/files/features/step_definitions/helper_steps.rb",
|
67
67
|
"fixtures/rails/files/features/step_definitions/image_steps.rb",
|
68
|
+
"fixtures/rails/files/features/step_definitions/web_steps.rb",
|
68
69
|
"fixtures/rails/files/features/support/paths.rb",
|
69
70
|
"fixtures/rails/files/features/text_images.feature",
|
70
71
|
"fixtures/rails/template.rb",
|
@@ -126,6 +127,7 @@ Gem::Specification.new do |s|
|
|
126
127
|
"lib/dragonfly/temp_object.rb",
|
127
128
|
"lib/dragonfly/url_attributes.rb",
|
128
129
|
"lib/dragonfly/url_mapper.rb",
|
130
|
+
"lib/dragonfly/utils.rb",
|
129
131
|
"samples/DSC02119.JPG",
|
130
132
|
"samples/a.jp2",
|
131
133
|
"samples/beach.jpg",
|
@@ -192,120 +194,76 @@ Gem::Specification.new do |s|
|
|
192
194
|
s.homepage = "http://github.com/markevans/dragonfly"
|
193
195
|
s.licenses = ["MIT"]
|
194
196
|
s.require_paths = ["lib"]
|
195
|
-
s.rubygems_version = "1.8.
|
197
|
+
s.rubygems_version = "1.8.24"
|
196
198
|
s.summary = "Ideal gem for handling attachments in Rails, Sinatra and Rack applications."
|
197
|
-
s.test_files = [
|
198
|
-
"spec/dragonfly/active_model_extensions/model_spec.rb",
|
199
|
-
"spec/dragonfly/active_model_extensions/spec_helper.rb",
|
200
|
-
"spec/dragonfly/analyser_spec.rb",
|
201
|
-
"spec/dragonfly/analysis/file_command_analyser_spec.rb",
|
202
|
-
"spec/dragonfly/app_spec.rb",
|
203
|
-
"spec/dragonfly/configurable_spec.rb",
|
204
|
-
"spec/dragonfly/cookie_monster_spec.rb",
|
205
|
-
"spec/dragonfly/core_ext/array_spec.rb",
|
206
|
-
"spec/dragonfly/core_ext/hash_spec.rb",
|
207
|
-
"spec/dragonfly/data_storage/couch_data_store_spec.rb",
|
208
|
-
"spec/dragonfly/data_storage/file_data_store_spec.rb",
|
209
|
-
"spec/dragonfly/data_storage/mongo_data_store_spec.rb",
|
210
|
-
"spec/dragonfly/data_storage/s3_data_store_spec.rb",
|
211
|
-
"spec/dragonfly/data_storage/shared_data_store_examples.rb",
|
212
|
-
"spec/dragonfly/function_manager_spec.rb",
|
213
|
-
"spec/dragonfly/has_filename_spec.rb",
|
214
|
-
"spec/dragonfly/hash_with_css_style_keys_spec.rb",
|
215
|
-
"spec/dragonfly/image_magick/analyser_spec.rb",
|
216
|
-
"spec/dragonfly/image_magick/encoder_spec.rb",
|
217
|
-
"spec/dragonfly/image_magick/generator_spec.rb",
|
218
|
-
"spec/dragonfly/image_magick/processor_spec.rb",
|
219
|
-
"spec/dragonfly/job_builder_spec.rb",
|
220
|
-
"spec/dragonfly/job_definitions_spec.rb",
|
221
|
-
"spec/dragonfly/job_endpoint_spec.rb",
|
222
|
-
"spec/dragonfly/job_spec.rb",
|
223
|
-
"spec/dragonfly/loggable_spec.rb",
|
224
|
-
"spec/dragonfly/middleware_spec.rb",
|
225
|
-
"spec/dragonfly/routed_endpoint_spec.rb",
|
226
|
-
"spec/dragonfly/serializer_spec.rb",
|
227
|
-
"spec/dragonfly/server_spec.rb",
|
228
|
-
"spec/dragonfly/shell_spec.rb",
|
229
|
-
"spec/dragonfly/simple_cache_spec.rb",
|
230
|
-
"spec/dragonfly/temp_object_spec.rb",
|
231
|
-
"spec/dragonfly/url_attributes.rb",
|
232
|
-
"spec/dragonfly/url_mapper_spec.rb",
|
233
|
-
"spec/functional/deprecations_spec.rb",
|
234
|
-
"spec/functional/image_magick_app_spec.rb",
|
235
|
-
"spec/functional/model_urls_spec.rb",
|
236
|
-
"spec/functional/remote_on_the_fly_spec.rb",
|
237
|
-
"spec/functional/shell_commands_spec.rb",
|
238
|
-
"spec/functional/to_response_spec.rb",
|
239
|
-
"spec/spec_helper.rb",
|
240
|
-
"spec/support/argument_matchers.rb",
|
241
|
-
"spec/support/image_matchers.rb",
|
242
|
-
"spec/support/simple_matchers.rb"
|
243
|
-
]
|
244
199
|
|
245
200
|
if s.respond_to? :specification_version then
|
246
201
|
s.specification_version = 3
|
247
202
|
|
248
203
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
249
204
|
s.add_runtime_dependency(%q<rack>, [">= 0"])
|
205
|
+
s.add_runtime_dependency(%q<multi_json>, ["~> 1.0"])
|
250
206
|
s.add_development_dependency(%q<capybara>, [">= 0"])
|
251
|
-
s.add_development_dependency(%q<cucumber>, ["~>
|
252
|
-
s.add_development_dependency(%q<cucumber-rails>, ["~>
|
207
|
+
s.add_development_dependency(%q<cucumber>, ["~> 1.2.1"])
|
208
|
+
s.add_development_dependency(%q<cucumber-rails>, ["~> 1.3.0"])
|
253
209
|
s.add_development_dependency(%q<database_cleaner>, [">= 0"])
|
254
|
-
s.add_development_dependency(%q<jeweler>, ["
|
210
|
+
s.add_development_dependency(%q<jeweler>, [">= 1.5.2"])
|
255
211
|
s.add_development_dependency(%q<fog>, [">= 0"])
|
256
212
|
s.add_development_dependency(%q<github-markup>, [">= 0"])
|
257
213
|
s.add_development_dependency(%q<mongo>, [">= 0"])
|
258
214
|
s.add_development_dependency(%q<couchrest>, ["~> 1.0"])
|
259
215
|
s.add_development_dependency(%q<rack-cache>, [">= 0"])
|
260
|
-
s.add_development_dependency(%q<rails>, ["~> 3.
|
261
|
-
s.add_development_dependency(%q<redcarpet>, ["~> 1.0"])
|
216
|
+
s.add_development_dependency(%q<rails>, ["~> 3.2.0"])
|
262
217
|
s.add_development_dependency(%q<rspec>, ["~> 2.5"])
|
263
218
|
s.add_development_dependency(%q<webmock>, [">= 0"])
|
264
219
|
s.add_development_dependency(%q<yard>, [">= 0"])
|
220
|
+
s.add_development_dependency(%q<redcarpet>, ["~> 1.0"])
|
265
221
|
s.add_development_dependency(%q<bluecloth>, [">= 0"])
|
266
222
|
s.add_development_dependency(%q<bson_ext>, [">= 0"])
|
267
|
-
s.add_development_dependency(%q<sqlite3
|
223
|
+
s.add_development_dependency(%q<sqlite3>, [">= 0"])
|
268
224
|
else
|
269
225
|
s.add_dependency(%q<rack>, [">= 0"])
|
226
|
+
s.add_dependency(%q<multi_json>, ["~> 1.0"])
|
270
227
|
s.add_dependency(%q<capybara>, [">= 0"])
|
271
|
-
s.add_dependency(%q<cucumber>, ["~>
|
272
|
-
s.add_dependency(%q<cucumber-rails>, ["~>
|
228
|
+
s.add_dependency(%q<cucumber>, ["~> 1.2.1"])
|
229
|
+
s.add_dependency(%q<cucumber-rails>, ["~> 1.3.0"])
|
273
230
|
s.add_dependency(%q<database_cleaner>, [">= 0"])
|
274
|
-
s.add_dependency(%q<jeweler>, ["
|
231
|
+
s.add_dependency(%q<jeweler>, [">= 1.5.2"])
|
275
232
|
s.add_dependency(%q<fog>, [">= 0"])
|
276
233
|
s.add_dependency(%q<github-markup>, [">= 0"])
|
277
234
|
s.add_dependency(%q<mongo>, [">= 0"])
|
278
235
|
s.add_dependency(%q<couchrest>, ["~> 1.0"])
|
279
236
|
s.add_dependency(%q<rack-cache>, [">= 0"])
|
280
|
-
s.add_dependency(%q<rails>, ["~> 3.
|
281
|
-
s.add_dependency(%q<redcarpet>, ["~> 1.0"])
|
237
|
+
s.add_dependency(%q<rails>, ["~> 3.2.0"])
|
282
238
|
s.add_dependency(%q<rspec>, ["~> 2.5"])
|
283
239
|
s.add_dependency(%q<webmock>, [">= 0"])
|
284
240
|
s.add_dependency(%q<yard>, [">= 0"])
|
241
|
+
s.add_dependency(%q<redcarpet>, ["~> 1.0"])
|
285
242
|
s.add_dependency(%q<bluecloth>, [">= 0"])
|
286
243
|
s.add_dependency(%q<bson_ext>, [">= 0"])
|
287
|
-
s.add_dependency(%q<sqlite3
|
244
|
+
s.add_dependency(%q<sqlite3>, [">= 0"])
|
288
245
|
end
|
289
246
|
else
|
290
247
|
s.add_dependency(%q<rack>, [">= 0"])
|
248
|
+
s.add_dependency(%q<multi_json>, ["~> 1.0"])
|
291
249
|
s.add_dependency(%q<capybara>, [">= 0"])
|
292
|
-
s.add_dependency(%q<cucumber>, ["~>
|
293
|
-
s.add_dependency(%q<cucumber-rails>, ["~>
|
250
|
+
s.add_dependency(%q<cucumber>, ["~> 1.2.1"])
|
251
|
+
s.add_dependency(%q<cucumber-rails>, ["~> 1.3.0"])
|
294
252
|
s.add_dependency(%q<database_cleaner>, [">= 0"])
|
295
|
-
s.add_dependency(%q<jeweler>, ["
|
253
|
+
s.add_dependency(%q<jeweler>, [">= 1.5.2"])
|
296
254
|
s.add_dependency(%q<fog>, [">= 0"])
|
297
255
|
s.add_dependency(%q<github-markup>, [">= 0"])
|
298
256
|
s.add_dependency(%q<mongo>, [">= 0"])
|
299
257
|
s.add_dependency(%q<couchrest>, ["~> 1.0"])
|
300
258
|
s.add_dependency(%q<rack-cache>, [">= 0"])
|
301
|
-
s.add_dependency(%q<rails>, ["~> 3.
|
302
|
-
s.add_dependency(%q<redcarpet>, ["~> 1.0"])
|
259
|
+
s.add_dependency(%q<rails>, ["~> 3.2.0"])
|
303
260
|
s.add_dependency(%q<rspec>, ["~> 2.5"])
|
304
261
|
s.add_dependency(%q<webmock>, [">= 0"])
|
305
262
|
s.add_dependency(%q<yard>, [">= 0"])
|
263
|
+
s.add_dependency(%q<redcarpet>, ["~> 1.0"])
|
306
264
|
s.add_dependency(%q<bluecloth>, [">= 0"])
|
307
265
|
s.add_dependency(%q<bson_ext>, [">= 0"])
|
308
|
-
s.add_dependency(%q<sqlite3
|
266
|
+
s.add_dependency(%q<sqlite3>, [">= 0"])
|
309
267
|
end
|
310
268
|
end
|
311
269
|
|
data/extra_docs/Rails3.md
CHANGED
@@ -10,5 +10,5 @@ Feature: winner uses dragonfly to serve different kinds of files
|
|
10
10
|
Given a stored file "sample.docx"
|
11
11
|
When I go to the url for "sample.docx"
|
12
12
|
Then the response should be OK
|
13
|
-
And the response should have mime-type 'application/
|
13
|
+
And the response should have mime-type 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
14
14
|
And the response should have the same content as the file "sample.docx"
|
@@ -0,0 +1,189 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'cgi'
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
4
|
+
|
5
|
+
module WithinHelpers
|
6
|
+
def with_scope(locator)
|
7
|
+
locator ? within(*selector_for(locator)) { yield } : yield
|
8
|
+
end
|
9
|
+
end
|
10
|
+
World(WithinHelpers)
|
11
|
+
|
12
|
+
# Single-line step scoper
|
13
|
+
When /^(.*) within (.*[^:])$/ do |step, parent|
|
14
|
+
with_scope(parent) { When step }
|
15
|
+
end
|
16
|
+
|
17
|
+
# Multi-line step scoper
|
18
|
+
When /^(.*) within (.*[^:]):$/ do |step, parent, table_or_string|
|
19
|
+
with_scope(parent) { When "#{step}:", table_or_string }
|
20
|
+
end
|
21
|
+
|
22
|
+
Given /^(?:|I )am on (.+)$/ do |page_name|
|
23
|
+
visit path_to(page_name)
|
24
|
+
end
|
25
|
+
|
26
|
+
When /^(?:|I )go to (.+)$/ do |page_name|
|
27
|
+
visit path_to(page_name)
|
28
|
+
end
|
29
|
+
|
30
|
+
When /^(?:|I )press "([^"]*)"$/ do |button|
|
31
|
+
click_button(button)
|
32
|
+
end
|
33
|
+
|
34
|
+
When /^(?:|I )follow "([^"]*)"$/ do |link|
|
35
|
+
click_link(link)
|
36
|
+
end
|
37
|
+
|
38
|
+
When /^(?:|I )fill in "([^"]*)" with "([^"]*)"$/ do |field, value|
|
39
|
+
fill_in(field, :with => value)
|
40
|
+
end
|
41
|
+
|
42
|
+
When /^(?:|I )fill in "([^"]*)" for "([^"]*)"$/ do |value, field|
|
43
|
+
fill_in(field, :with => value)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Use this to fill in an entire form with data from a table. Example:
|
47
|
+
#
|
48
|
+
# When I fill in the following:
|
49
|
+
# | Account Number | 5002 |
|
50
|
+
# | Expiry date | 2009-11-01 |
|
51
|
+
# | Note | Nice guy |
|
52
|
+
# | Wants Email? | |
|
53
|
+
#
|
54
|
+
# TODO: Add support for checkbox, select og option
|
55
|
+
# based on naming conventions.
|
56
|
+
#
|
57
|
+
When /^(?:|I )fill in the following:$/ do |fields|
|
58
|
+
fields.rows_hash.each do |name, value|
|
59
|
+
When %{I fill in "#{name}" with "#{value}"}
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
When /^(?:|I )select "([^"]*)" from "([^"]*)"$/ do |value, field|
|
64
|
+
select(value, :from => field)
|
65
|
+
end
|
66
|
+
|
67
|
+
When /^(?:|I )check "([^"]*)"$/ do |field|
|
68
|
+
check(field)
|
69
|
+
end
|
70
|
+
|
71
|
+
When /^(?:|I )uncheck "([^"]*)"$/ do |field|
|
72
|
+
uncheck(field)
|
73
|
+
end
|
74
|
+
|
75
|
+
When /^(?:|I )choose "([^"]*)"$/ do |field|
|
76
|
+
choose(field)
|
77
|
+
end
|
78
|
+
|
79
|
+
When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"$/ do |path, field|
|
80
|
+
attach_file(field, File.expand_path(path))
|
81
|
+
end
|
82
|
+
|
83
|
+
Then /^(?:|I )should see "([^"]*)"$/ do |text|
|
84
|
+
if page.respond_to? :should
|
85
|
+
page.should have_content(text)
|
86
|
+
else
|
87
|
+
assert page.has_content?(text)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
Then /^(?:|I )should see \/([^\/]*)\/$/ do |regexp|
|
92
|
+
regexp = Regexp.new(regexp)
|
93
|
+
|
94
|
+
if page.respond_to? :should
|
95
|
+
page.should have_xpath('//*', :text => regexp)
|
96
|
+
else
|
97
|
+
assert page.has_xpath?('//*', :text => regexp)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
Then /^(?:|I )should not see "([^"]*)"$/ do |text|
|
102
|
+
if page.respond_to? :should
|
103
|
+
page.should have_no_content(text)
|
104
|
+
else
|
105
|
+
assert page.has_no_content?(text)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
Then /^(?:|I )should not see \/([^\/]*)\/$/ do |regexp|
|
110
|
+
regexp = Regexp.new(regexp)
|
111
|
+
|
112
|
+
if page.respond_to? :should
|
113
|
+
page.should have_no_xpath('//*', :text => regexp)
|
114
|
+
else
|
115
|
+
assert page.has_no_xpath?('//*', :text => regexp)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
Then /^the "([^"]*)" field(?: within (.*))? should contain "([^"]*)"$/ do |field, parent, value|
|
120
|
+
with_scope(parent) do
|
121
|
+
field = find_field(field)
|
122
|
+
field_value = (field.tag_name == 'textarea') ? field.text : field.value
|
123
|
+
if field_value.respond_to? :should
|
124
|
+
field_value.should =~ /#{value}/
|
125
|
+
else
|
126
|
+
assert_match(/#{value}/, field_value)
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
Then /^the "([^"]*)" field(?: within (.*))? should not contain "([^"]*)"$/ do |field, parent, value|
|
132
|
+
with_scope(parent) do
|
133
|
+
field = find_field(field)
|
134
|
+
field_value = (field.tag_name == 'textarea') ? field.text : field.value
|
135
|
+
if field_value.respond_to? :should_not
|
136
|
+
field_value.should_not =~ /#{value}/
|
137
|
+
else
|
138
|
+
assert_no_match(/#{value}/, field_value)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
Then /^the "([^"]*)" checkbox(?: within (.*))? should be checked$/ do |label, parent|
|
144
|
+
with_scope(parent) do
|
145
|
+
field_checked = find_field(label)['checked']
|
146
|
+
if field_checked.respond_to? :should
|
147
|
+
field_checked.should be_true
|
148
|
+
else
|
149
|
+
assert field_checked
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
Then /^the "([^"]*)" checkbox(?: within (.*))? should not be checked$/ do |label, parent|
|
155
|
+
with_scope(parent) do
|
156
|
+
field_checked = find_field(label)['checked']
|
157
|
+
if field_checked.respond_to? :should
|
158
|
+
field_checked.should be_false
|
159
|
+
else
|
160
|
+
assert !field_checked
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
Then /^(?:|I )should be on (.+)$/ do |page_name|
|
166
|
+
current_path = URI.parse(current_url).path
|
167
|
+
if current_path.respond_to? :should
|
168
|
+
current_path.should == path_to(page_name)
|
169
|
+
else
|
170
|
+
assert_equal path_to(page_name), current_path
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
|
175
|
+
query = URI.parse(current_url).query
|
176
|
+
actual_params = query ? CGI.parse(query) : {}
|
177
|
+
expected_params = {}
|
178
|
+
expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')}
|
179
|
+
|
180
|
+
if actual_params.respond_to? :should
|
181
|
+
actual_params.should == expected_params
|
182
|
+
else
|
183
|
+
assert_equal expected_params, actual_params
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
Then /^show me the page$/ do
|
188
|
+
save_and_open_page
|
189
|
+
end
|