
Untitled
By: a guest on
May 2nd, 2012 | syntax:
None | size: 0.61 KB | hits: 15 | expires: Never
# an example, showing how to load for rspec and conditionally load for cucumber
# lives in whichever dir you set the other file to load
module ImageStepHelpers
def page_should_contain_image_link_for(image)
page.should have_xpath(%Q(//img[@src="#{image.url}"]))
end
def image_data_from_file(image)
image_file_path = Rails.root.join image.image.path
File.read(image_file_path)
end
def hash_image(image_data)
require 'md5'
MD5.digest(image_data)
end
end
RSpec.configure do |config|
config.include ImageStepHelpers, :type => :request
end
World(ImageStepHelpers) if respond_to?(:World) #cucumber