Created
March 19, 2012 04:56
-
-
Save coop/2095917 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class HeroPage < AR::Base | |
| def online_total! | |
| save! | |
| end | |
| end | |
| class HeroPageTest < ActiveSupport::TestCase | |
| test "#total_in_aud includes the registration total" do | |
| mock_hero_page = Class.new SimpleDelegator do | |
| def save! | |
| raise 'I HATE YOU' | |
| end | |
| end | |
| hero_page = mock_hero_page.new(HeroPage.new) | |
| assert hero_page.online_total! # => Raises with validation errors | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment