Skip to content

Instantly share code, notes, and snippets.

@ClayShentrup
Last active June 19, 2016 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ClayShentrup/c82cb76fe236a372bd9e7b7466c750b9 to your computer and use it in GitHub Desktop.
Save ClayShentrup/c82cb76fe236a372bd9e7b7466c750b9 to your computer and use it in GitHub Desktop.
expected collection contained: [#<User id: 1, email: "user1@example.com", ...a bunch of attributes...>]
actual collection contained: [#<User id: 1, email: "user1@example.com", ...a bunch of attributes...>,
#<User id: 2, email: "user2@example.com", ...a bunch of attributes...>]
describe(User) do
describe('.old_enough_to_drink') do
let!(:bob) { create(:user, age: 21) }
let!(:alice) { create(:user, age: 20) }
specify do
expect(described_class.old_enough_to_drink).to eq([bob])
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment