Permalink
Browse files

Added a step to compare actual images

  • Loading branch information...
1 parent 88b616e commit 12745c45ef685fb896f10abda83e26a424cd8a61 @jyurek jyurek committed Jul 23, 2010
Showing with 7 additions and 1 deletion.
  1. +1 −0 features/rails.feature
  2. +5 −0 features/step_definitions/html_steps.rb
  3. +1 −1 features/step_definitions/rails_steps.rb
View
1 features/rails.feature
@@ -31,3 +31,4 @@ Feature: Running paperclip in a Rails app
And I press "Submit"
Then I should see "Name: something"
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"
View
5 features/step_definitions/html_steps.rb
@@ -1,3 +1,8 @@
Then %r{I should see an image with a path of "([^"]*)"} do |path|
page.should have_css("img[src^='#{path}']")
end
+
+Then %r{^the file at "([^"]*)" is the same as "([^"]*)"$} do |web_file, path|
+ visit(web_file)
+ page.body.should == IO.read(path)
+end
View
2 features/step_definitions/rails_steps.rb
@@ -24,7 +24,7 @@
When %r{the rails application is running} do
Dir.chdir(CUC_RAILS_ROOT) do
require "config/environment"
- Capybara.app = ActionController::Dispatcher.new
+ require "capybara/rails"
end
end

0 comments on commit 12745c4

Please sign in to comment.