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

Version Path
hubstats-1.2.1 spec/factories/comment.rb
hubstats-1.2.0 spec/factories/comment.rb
hubstats-1.1.0 spec/factories/comment.rb
hubstats-1.0.0 spec/factories/comment.rb
hubstats-1.0.0.beta3 spec/factories/comment.rb
hubstats-1.0.0.beta2 spec/factories/comment.rb
hubstats-1.0.0.beta1 spec/factories/comment.rb
hubstats-1.0.0.beta spec/factories/comment.rb
hubstats-0.12.2 spec/factories/comment.rb
hubstats-0.12.1 spec/factories/comment.rb
hubstats-0.12.0 spec/factories/comment.rb
hubstats-0.11.5 spec/factories/comment.rb
hubstats-0.11.4 spec/factories/comment.rb
hubstats-0.11.1 spec/factories/comment.rb
hubstats-0.11.0 spec/factories/comment.rb
hubstats-0.10.0 spec/factories/comment.rb
hubstats-0.9.5 spec/factories/comment.rb
hubstats-0.9.4 spec/factories/comment.rb
hubstats-0.9.3 spec/factories/comment.rb
hubstats-0.9.2 spec/factories/comment.rb