Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

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

Select an option

Save avegancafe/c30018bcd3fecb5cd0601bdd36170b9b to your computer and use it in GitHub Desktop.
Examples for RSpec Formatting Blog Post - space_authority_array_expectations_spec.rb
describe SpaceAuthority do
describe '#authorized_spaces' do
let!(:authorized_space_through_property) { create(:space, ...) }
let!(:authorized_space_directly) { create(:space, ...) }
let!(:unauthorized_space) { create(:space, ...) }
subject { described_class.new(user).authorized_spaces }
it 'only lists authorized spaces' do
expect(subject).to match_array([
authorized_space_through_property,
authorized_space_directly
])
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment