-
Notifications
You must be signed in to change notification settings - Fork 74
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
Remove repeated @cinstances variable #423
Conversation
2ea7a9c
to
01ea8c4
Compare
Codecov Report
@@ Coverage Diff @@
## master #423 +/- ##
==========================================
- Coverage 92.72% 92.72% -0.01%
==========================================
Files 2341 2341
Lines 75549 75548 -1
==========================================
- Hits 70055 70054 -1
Misses 5494 5494
Continue to review full report at Codecov.
|
@@ -53,7 +53,7 @@ def setup | |||
get :index | |||
|
|||
doc = Nokogiri::HTML.parse(response.body) | |||
assert_equal [@live_app1, @live_app2], @controller.instance_variable_get('@cinstances') | |||
assert_equal [@live_app1, @live_app2], @controller.instance_variable_get('@applications') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use assigns(:applications)
instead ... BUT functional tests are deprecated
rails/rails#18950 https://github.com/rails/rails/blob/35e0190ac54ec852f8ff5b9196ccf8a24e8d193b/actionpack/lib/action_controller/test_case.rb#L29
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, I am not adding any test, just removing the unused variable and changing the super old test for the variable that we are actually using 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use assigns
at least to get rid of the ugly instance_variable_get
01ea8c4
to
6c9f8c1
Compare
It uses the
@applications
instead 😄The only places in views where this is used is: