Skip to content

Instantly share code, notes, and snippets.

@simi
Created October 14, 2011 13:36
Show Gist options
  • Select an option

  • Save simi/1287123 to your computer and use it in GitHub Desktop.

Select an option

Save simi/1287123 to your computer and use it in GitHub Desktop.
dsl example
@jane = Factory(:user)
@reward = Factory(:reward, :name => 'Invite friends', :points => 50, :every => 1.day)
@jane.can_achieve?(:invite_friends).should be true
@jane.achieve!(:invite_friends)
@jane.points.should be 50
@jane.can_achieve?(:invite_friends).should be false
@jane.time_to_unlock(:invite_friends).should be < 1.day
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment