Commit 12745c45 by Jon Yurek

Added a step to compare actual images

parent 88b616e1
...@@ -31,3 +31,4 @@ Feature: Running paperclip in a Rails app ...@@ -31,3 +31,4 @@ Feature: Running paperclip in a Rails app
And I press "Submit" And I press "Submit"
Then I should see "Name: something" Then I should see "Name: something"
And I should see an image with a path of "/system/avatars/1/original/5k.png" And I should see an image with a path of "/system/avatars/1/original/5k.png"
And the file at "/system/avatars/1/original/5k.png" is the same as "test/fixtures/5k.png"
Then %r{I should see an image with a path of "([^"]*)"} do |path| Then %r{I should see an image with a path of "([^"]*)"} do |path|
page.should have_css("img[src^='#{path}']") page.should have_css("img[src^='#{path}']")
end end
Then %r{^the file at "([^"]*)" is the same as "([^"]*)"$} do |web_file, path|
visit(web_file)
page.body.should == IO.read(path)
end
...@@ -24,7 +24,7 @@ end ...@@ -24,7 +24,7 @@ end
When %r{the rails application is running} do When %r{the rails application is running} do
Dir.chdir(CUC_RAILS_ROOT) do Dir.chdir(CUC_RAILS_ROOT) do
require "config/environment" require "config/environment"
Capybara.app = ActionController::Dispatcher.new require "capybara/rails"
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment