-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Deploy from CI
committed
Mar 25, 2024
0 parents
commit 12d96e7
Showing
149 changed files
with
26,475 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: 'bug' | ||
assignees: '' | ||
|
||
--- | ||
|
||
<!-- By contributing to this project, you agree to abide by the thoughtbot Code | ||
of Conduct: https://thoughtbot.com/open-source-code-of-conduct --> | ||
|
||
### Description | ||
|
||
<!-- A clear and concise description of what the bug is. --> | ||
|
||
### Reproduction Steps | ||
|
||
<!-- Steps for others to reproduce the bug. Be as specific as possible. A | ||
reproduction script or link to a sample application that demonstrates the | ||
problem are especially helpful. --> | ||
|
||
<!-- You can create a reproduction script by copying this sample reproduction | ||
script and adding whatever code is necessary to get a failing test case: | ||
https://github.com/thoughtbot/factory_bot/blob/main/.github/REPRODUCTION_SCRIPT.rb --> | ||
|
||
### Expected behavior | ||
|
||
<!-- What you expected to happen. --> | ||
|
||
### Actual behavior | ||
|
||
<!-- What happened instead. --> | ||
|
||
### System configuration | ||
**factory_bot version**: | ||
**rails version**: | ||
**ruby version**: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: 'feature' | ||
assignees: '' | ||
|
||
--- | ||
|
||
<!-- By contributing to this project, you agree to abide by the thoughtbot Code | ||
of Conduct: https://thoughtbot.com/open-source-code-of-conduct --> | ||
|
||
### Problem this feature will solve | ||
|
||
<!-- A clear and concise description of what the problem is. Ex. When doing | ||
[...] I find it difficult to [...] --> | ||
|
||
### Desired solution | ||
|
||
<!-- The feature or change that would solve the problem --> | ||
|
||
## Alternatives considered | ||
|
||
<!-- Any alternative solutions or features you've considered. --> | ||
|
||
## Additional context | ||
|
||
<!-- Add any other context about this feature request. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
require "bundler/inline" | ||
|
||
gemfile(true) do | ||
source "https://rubygems.org" | ||
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | ||
gem "factory_bot", "~> 6.0" | ||
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 | ||
# TODO: Update the schema to include the specific tables or columns necessary | ||
# to reproduct the bug | ||
create_table :posts, force: true do |t| | ||
t.string :body | ||
end | ||
end | ||
|
||
# TODO: Add any application specific code necessary to reproduce the bug | ||
class Post < ActiveRecord::Base | ||
end | ||
|
||
FactoryBot.define do | ||
# TODO: Write the factory definitions necessary to reproduce the bug | ||
factory :post do | ||
body { "Post body" } | ||
end | ||
end | ||
|
||
class FactoryBotTest < Minitest::Test | ||
def test_factory_bot_stuff | ||
# TODO: Write a failing test case to demonstrate what isn't working as | ||
# expected | ||
body_override = "Body override" | ||
|
||
post = FactoryBot.build(:post, body: body_override) | ||
|
||
assert_equal post.body, body_override | ||
end | ||
end | ||
|
||
# Run the tests with `ruby <filename>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Build | ||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
build: | ||
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby: | ||
- jruby-9.4 | ||
- truffleruby | ||
- "3.2" | ||
- "3.1" | ||
- "3.0" | ||
rails: | ||
- "6.1" | ||
- "7.0" | ||
- "7.1" | ||
- main | ||
exclude: | ||
- ruby: jruby-9.4 | ||
rails: "7.1" | ||
- ruby: jruby-9.4 | ||
rails: main | ||
|
||
runs-on: 'ubuntu-latest' | ||
|
||
env: | ||
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
- name: Setup project | ||
run: bundle install | ||
- name: Run test | ||
run: bundle exec rake all_specs | ||
|
||
standard: | ||
name: Run standard | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.1" | ||
- name: Setup project | ||
run: bundle install | ||
- name: Run test | ||
run: bundle exec rake standard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Docs | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # To push a branch | ||
pull-requests: write # To create a PR from that branch | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install mdbook | ||
run: | | ||
mkdir mdbook | ||
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook | ||
echo `pwd`/mdbook >> $GITHUB_PATH | ||
- name: Deploy GitHub Pages | ||
run: | | ||
cd docs | ||
mdbook build | ||
git worktree add gh-pages | ||
git config user.name "Deploy from CI" | ||
git config user.email "" | ||
cd gh-pages | ||
# Delete the ref to avoid keeping history. | ||
git update-ref -d refs/heads/gh-pages | ||
rm -rf * | ||
mv ../book/* . | ||
git add . | ||
git commit -m "Deploy $GITHUB_SHA to gh-pages" | ||
git push --force --set-upstream origin gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: update-templates | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update-templates: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
pages: write | ||
uses: thoughtbot/templates/.github/workflows/dynamic-readme.yaml@main | ||
secrets: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
*.swp | ||
test.db | ||
factory_girl-*.gem | ||
factory_bot-*.gem | ||
docs/book | ||
.yardoc | ||
coverage | ||
.bundle | ||
tmp | ||
bin | ||
.rubocop-https* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--format progress | ||
--color | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SimpleCov.start do | ||
add_filter "/spec/" | ||
add_filter "/tmp/" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ruby_version: "3.0" | ||
parallel: true | ||
format: progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
lib/**/*.rb | ||
- | ||
GETTING_STARTED.md | ||
CONTRIBUTING.md | ||
NAME.md | ||
LICENSE |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.