Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test fix for save_page with binary content

  • Loading branch information...
commit 2e4f268500f3f8bc00d21092f6515256656a6013 1 parent 355ae9a
@mhoran authored
View
2  Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: git://github.com/thoughtbot/capybara-webkit.git
- revision: f8731b692a030a8f83f0375ae7127f44c9a97ef4
+ revision: e72b48fc26549c81251c202c864cebe112042b4a
specs:
capybara-webkit (0.14.1)
capybara (~> 2.0, >= 2.0.2)
View
7 features/save_page.feature
@@ -0,0 +1,7 @@
+Feature: Testing save_page
+
+ @javascript
+ Scenario:
+ Given I am on a page with binary content
+ When I save the current page
+ Then the binary content should match the source content
View
12 features/step_definitions/save_page_steps.rb
@@ -0,0 +1,12 @@
+Given "I am on a page with binary content" do
+ visit '/workcam.jpg'
+end
+
+When "I save the current page" do
+ save_page(Rails.root.join('tmp', 'workcam.jpg'))
+end
+
+Then "the binary content should match the source content" do
+ File.read(Rails.root.join('public', 'workcam.jpg')).should ==
+ File.read(Rails.root.join('tmp', 'workcam.jpg'))
+end
View
BIN  public/workcam.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.