Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save avegancafe/0866f4365a1764e6c05beb528197f5a3 to your computer and use it in GitHub Desktop.

Select an option

Save avegancafe/0866f4365a1764e6c05beb528197f5a3 to your computer and use it in GitHub Desktop.
Examples for RSpec Formatting Blog Post - space_authority_a_few_eager_objects_spec.rb
describe SpaceAuthority do
let!(:property) do
# this property is needed in all tests
end
context 'property tests' do
# no extra objects needed here
end
# floor and space tests utilize top-level property, but instantiate
# objects that are specific to their context
context 'floor tests' do
let!(:floor) { create(:floor, property: property) }
end
context 'space tests' do
let!(:space) { create(:space, property: property) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment