Description
Hello! I was reading the documentation on restricting the sequence to an initial starting value. Following the documentation as written has no effect.
Reproduction Steps
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "factory_bot", "6.4.6"
gem "activerecord"
gem "sqlite3"
end
require "active_record"
require "factory_bot"
require "minitest/autorun"
require "logger"
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Schema.define do
create_table :posts, force: true do |t|
t.integer :number_of_characters
end
end
class Post < ActiveRecord::Base
end
FactoryBot.define do
factory :post do
sequence(:body, 1)
end
end
class FactoryBotTest < Minitest::Test
def test_factory_bot_stuff
post = FactoryBot.create(:post)
assert_equal post.number_of_characters, 1
end
end
Expected behavior
The sequence starts with the integer 1.
Actual behavior
The sequence starts with the integer 4.
System configuration
6.4.6:
6.1.7.7:
3.1.5:
Description
Hello! I was reading the documentation on restricting the sequence to an initial starting value. Following the documentation as written has no effect.
Reproduction Steps
Expected behavior
The sequence starts with the integer 1.
Actual behavior
The sequence starts with the integer 4.
System configuration
6.4.6:
6.1.7.7:
3.1.5: