Skip to content

Remove useless ivar assign in controller spec #1932

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

Merged
merged 1 commit into from
Dec 21, 2017
Merged

Conversation

riseshia
Copy link
Contributor

This assignment is not necessary here.
It maybe need to be someone, but there is no reason to assign in generated code at least ;)

before rspec-rails generates(model: Person, Rails > 5):

describe "GET #index" do
  it "returns a success response" do
    person = Person.create! valid_attributes
    get :index, params: {}, session: valid_session
    expect(response).to be_success
  end
end

after:

describe "GET #index" do
  it "returns a success response" do
    Person.create! valid_attributes
    get :index, params: {}, session: valid_session
    expect(response).to be_success
  end
end

How do you think?

This assignment is not necessary here.
@JonRowe JonRowe merged commit ba4874f into rspec:master Dec 21, 2017
@JonRowe
Copy link
Member

JonRowe commented Dec 21, 2017

Thanks ❤️ although this was a local var not an ivar for future reference :)

@riseshia riseshia deleted the patch-1 branch December 21, 2017 09:16
@riseshia
Copy link
Contributor Author

😭 Thanks to fix my poor english

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.

2 participants