Created
March 22, 2011 00:20
-
-
Save oliverbarnes/880522 to your computer and use it in GitHub Desktop.
Finding dragonfly image with cucumber/capybara
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config | |
app.url_path_prefix = '/images' | |
#route | |
match '/images/:dragonfly/:file_name', :to => Dragonfly[:images] | |
#model | |
class Store | |
include MongoMapper::Document | |
key :photo_uid, String | |
key :photo_name, String | |
image_accessor :photo | |
def photo_url | |
self.photo.thumb('274x207#').url(:suffix => "/#{self.photo_name}") if self.photo | |
end | |
end | |
#cucumber | |
Then I should see the image "my_photo.png" | |
Then /^I should see the image "(.+)"$/ do |image| | |
page.should have_xpath("//img[contains(@src, \"#{image}\")]") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment