Skip to content
Browse files

Proper test for save_and_open_page

  • Loading branch information...
1 parent f62f18e commit 29d9a56313a9c0aeb756c5206863c3b831d9b5eb @bcardarella bcardarella committed Mar 4, 2012
Showing with 3 additions and 1 deletion.
  1. +1 −0 lib/capybara/node/email.rb
  2. +2 −1 spec/node/email_spec.rb
View
1 lib/capybara/node/email.rb
@@ -17,6 +17,7 @@ def from
end
def save_and_open
+ require 'capybara/util/save_and_open_page'
::Capybara.save_and_open_page(body)
end
View
3 spec/node/email_spec.rb
@@ -60,13 +60,14 @@
describe '#save_and_open' do
before do
+ require 'capybara/util/save_and_open_page'
message.body = 'Test message'
::Capybara.stubs(:save_and_open_page)
end
it 'delegates to Capybara.save_and_open_page' do
email.save_and_open
- Capybara.should have_received(:save_and_open_page)
+ Capybara.should have_received(:save_and_open_page).with('Test message')
end
end
end

0 comments on commit 29d9a56

Please sign in to comment.
Something went wrong with that request. Please try again.