Sha256: e655cdf66312487065965fef42b2720bc3844a9314d529b277947ab1dc3a3ddf

Contents?: true

Size: 1.11 KB

Versions: 13

Compression:

Stored size: 1.11 KB

Contents

FactoryGirl.define do
  factory :pull_request, :class => Hubstats::PullRequest do
    user
    repo
    id {Faker::Number.number(6).to_i}
    number {|n| "#{n}".to_i}
  end

  factory :pull_request_hash, class:Hash do
    association :user, factory: :user_hash, strategy: :build
    association :repository, factory: :repo_hash, strategy: :build
    id {Faker::Number.number(6).to_i}
    number {|n| "#{n}".to_i}
    merged_by(:id => 202020)

    initialize_with { attributes } 
  end

  factory :pull_request_hash_no_merge, class:Hash do
    association :user, factory: :user_hash, strategy: :build
    association :repository, factory: :repo_hash, strategy: :build
    id {Faker::Number.number(6).to_i}
    number {|n| "#{n}".to_i}
    merged_by(nil)

    initialize_with { attributes } 
  end

  factory :pull_request_payload_hash, class:Hash do 
    id {Faker::Number.number(6).to_i}
    type "PullRequestEvent"
    association :repository, factory: :repo_hash, strategy: :build
    association :pull_request, factory: :pull_request_hash, strategy: :build
    merged_by(:id => 202020)

    initialize_with { attributes } 
  end 
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
hubstats-0.3.17 spec/factories/pull_requests.rb
hubstats-0.3.16 spec/factories/pull_requests.rb
hubstats-0.3.15 spec/factories/pull_requests.rb
hubstats-0.3.14 spec/factories/pull_requests.rb
hubstats-0.3.13 spec/factories/pull_requests.rb
hubstats-0.3.12 spec/factories/pull_requests.rb
hubstats-0.3.11 spec/factories/pull_requests.rb
hubstats-0.3.10 spec/factories/pull_requests.rb
hubstats-0.3.9 spec/factories/pull_requests.rb
hubstats-0.3.8 spec/factories/pull_requests.rb
hubstats-0.3.7 spec/factories/pull_requests.rb
hubstats-0.3.6 spec/factories/pull_requests.rb
hubstats-0.3.5 spec/factories/pull_requests.rb