Skip to content

Instantly share code, notes, and snippets.

@coop
Created March 19, 2012 04:56
Show Gist options
  • Select an option

  • Save coop/2095917 to your computer and use it in GitHub Desktop.

Select an option

Save coop/2095917 to your computer and use it in GitHub Desktop.
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