Sha256: 56a3f76952a33f569b5fb89a1afa54770b00d90cc3107fb2ca2da7e729d7e354
Contents?: true
Size: 953 Bytes
Versions: 39
Compression:
Stored size: 953 Bytes
Contents
# Generates fake comment data we can use to test with FactoryGirl.define do factory :comment, :class => Hubstats::Comment do user id {Faker::Number.number(6).to_i} body {Faker::Lorem.sentence} created_at '2015-05-30' end factory :comment_hash, class:Hash do association :user, factory: :user_hash, strategy: :build id {Faker::Number.number(6).to_i} body {Faker::Lorem.sentence} initialize_with { attributes } end factory :comment_payload_hash, class:Hash do id {Faker::Number.number(6).to_i} type ["IssueCommentEvent", "CommitCommentEvent", "PullRequestReviewCommentEvent"].sample association :user, factory: :user_hash, strategy: :build association :repository, factory: :repo_hash, strategy: :build association :pull_request, factory: :pull_request_hash, strategy: :build association :comment, factory: :comment_hash, strategy: :build initialize_with { attributes } end end
Version data entries
39 entries across 39 versions & 1 rubygems