Ruby Testing
RSpec Shared Examples and Contexts: DRY Test Patterns
Test duplication is a real problem. When you have ten model specs that each test the same #timestamps behavior, or five controller specs that each verify authentication, copy-paste is the wrong answer. RSpec gives you two tools for this: shared examples and shared contexts. Shared examples let you define