Created
November 3, 2014 18:10
-
-
Save eladmeidar/fc034329b74e2175bd99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TestFactories | |
def post_without_user(options={}) | |
post_options = {title: 'Post title', body: 'Post bodies must be pretty long.'}.merge(options) | |
post = Post.new(post_options) | |
post.save | |
post | |
end | |
def authenticated_user | |
email = "email#{rand}@fake.com" | |
user = User.new(email: email, password: 'password') | |
user.skip_confirmation! | |
user.save | |
user | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment