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

Feature/14 model spec #15

Merged
merged 4 commits into from Dec 10, 2021
Merged

Feature/14 model spec #15

merged 4 commits into from Dec 10, 2021

Conversation

kyafuso
Copy link
Owner

@kyafuso kyafuso commented Dec 8, 2021

レビューよろしくお願いします。

describe 'スコープ' do
describe 'body_contain' do
let!(:post) { create(:post, body: 'hello world') }
subject { Post.body_contain('hello') }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感覚的な回答をしますが、subjectを使うのはおしゃれですね!

ただ、あくまで個人的な印象ですが、subjectはあまり限定的に使わないイメージです。
使うのであれば統一して使って、テスト対象を明確させるために使うイメージです!

あと、職歴浅いので話1/3ぐらいで聴いてもらいたいですが、subjectを絶対使う派閥がいたり、いなかったりするみたいです。

このあたりは流派が分かれるらしいです。

伊藤淳一さんは使わない派閥らしいですが、すぐ見つかった参考記事を貼っておきます!
https://blog.jnito.com/entry/2021/10/09/105651

@kyafuso kyafuso merged commit 2a4b5ba into develop Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants