features/steps/dragonfly_steps.rb in dragonfly-0.6.2 vs features/steps/dragonfly_steps.rb in dragonfly-0.7.0

- old
+ new

@@ -1,7 +1,9 @@ +require 'tempfile' + Given /^we are using the app for (\w+)$/ do |app_name| - $app = Dragonfly::App[app_name.to_sym] + $app = Dragonfly[app_name.to_sym] end Given /^a stored file "(.+?)"$/ do |name| file = File.new(File.dirname(__FILE__) + "/../../samples/#{name}") uid = $app.store(file) @@ -14,26 +16,26 @@ uid = $app.store(tempfile) TEMP_FILES[name] = uid end When /^I go to the url for "(.+?)"$/ do |name| - make_request name + uid = TEMP_FILES[name] + make_request $app.fetch(uid) end -When /^I go to the url for "(.+?)", with format '([^']+?)'$/ do |name, ext| - make_request name, :format => ext +When /^I go to the url for "(.+?)", with format '([^']+?)'$/ do |name, format| + uid = TEMP_FILES[name] + make_request $app.fetch(uid).encode(format) end -When /^I go to the url for "(.+?)", with format '(.+?)' and resize geometry '(.+?)'$/ do |name, ext, geometry| - make_request(name, - :format => ext, - :processing_method => :resize, - :processing_options => {:geometry => geometry} - ) +When /^I go to the url for "(.+?)", with format '(.+?)' and resize geometry '(.+?)'$/ do |name, format, geometry| + uid = TEMP_FILES[name] + make_request $app.fetch(uid).process(:resize, geometry).encode(format) end -When /^I go to the url for "(.+?)", with shortcut '([^']+?)'$/ do |name, arg1| - make_request name, arg1 +When /^I go to the url for "(.+?)", with shortcut '([^']+?)'$/ do |name, geometry| + uid = TEMP_FILES[name] + make_request $app.fetch(uid).thumb(geometry) end Then "the response should be OK" do @response.status.should == 200 end