diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..82c59bb --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,16 @@ +### Steps to reproduce + + +[reproduction script]: https://github.com/thoughtbot/factory_bot/blob/master/.github/REPRODUCTION_SCRIPT.rb + +### Expected behavior + + +### Actual behavior + + +### System configuration +**factory_bot version**: +**rails version**: +**ruby version**: diff --git a/.github/REPRODUCTION_SCRIPT.rb b/.github/REPRODUCTION_SCRIPT.rb new file mode 100644 index 0000000..99b638a --- /dev/null +++ b/.github/REPRODUCTION_SCRIPT.rb @@ -0,0 +1,30 @@ +require "bundler/inline" + +gemfile(true) do + source "https://rubygems.org" + git_source(:github) { |repo| "https://github.com/#{repo}.git" } + gem "factory_bot", "~> 5.0" +end + +require "factory_bot" +require "minitest/autorun" + +class Post + attr_accessor :body +end + +FactoryBot.define do + factory :post do + body { "Post body" } + end +end + +class FactoryBotTest < Minitest::Test + def test_factory_bot_stuff + body_override = "Body override" + + post = FactoryBot.build(:post, body: body_override) + + assert_equal post.body, body_override + end +end