Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add issue templates #1594

Merged
merged 2 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
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: ''
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/shoulda-matchers/blob/main/.github/REPRODUCTION_SCRIPT.rb -->

### Expected behavior

<!-- What you expected to happen. -->

### Actual behavior

<!-- What happened instead. -->

### System configuration
**shoulda_matchers version**:
**rails version**:
**ruby version**:
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
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: ''
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. -->
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ AllCops:
TargetRubyVersion: 3.0
Exclude:
- 'gemfiles/*'
- 'REPRODUCTION_SCRIPT.rb'
Bundler/OrderedGems:
Include:
- '**/Gemfile'
Expand Down
52 changes: 52 additions & 0 deletions REPRODUCTION_SCRIPT.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
require 'bundler/inline'

gemfile(true) do
source 'https://rubygems.org'
gem 'shoulda-matchers'
gem 'activerecord'
gem 'sqlite3'
gem 'rspec'
end

require 'active_record'
require 'shoulda-matchers'
require 'logger'

ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
ActiveRecord::Base.logger = Logger.new(STDOUT)

# TODO: Update the schema to include the specific tables or columns necessary
# to reproduct the bug
ActiveRecord::Schema.define do
create_table :posts, force: true do |t|
t.string :body
end
end

Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec

with.library :active_record
with.library :active_model
end
end

RSpec.configure do |config|
config.include Shoulda::Matchers::ActiveRecord
config.include Shoulda::Matchers::ActiveModel
config.include Shoulda::Matchers::ActionController
end

# TODO: Add any application specific code necessary to reproduce the bug
class Post < ActiveRecord::Base
validates :body, uniqueness: true
end

# TODO: Write a failing test case to demonstrate what isn't working as
# expected
RSpec.describe Post do
describe 'validations' do
it { is_expected.to validate_uniqueness_of(:body) }
end
end