Skip to content

Don't rename the subject #7

@sirion1987

Description

@sirion1987
# good
RSpec.describe Foo do
  subject { described_class.new }

  it 'is valid' do
    expect(subject.valid?).to be(true)
  end
end
# bad
RSpec.describe Foo do
  # Foo or user?
  subject(:user) { described_class.new }

  it 'is valid' do
    expect(user.valid?).to be(true)
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions