-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 redundant code #3719
Remove redundant code #3719
Conversation
Since two records cannot have the same key, having a scope that will always return just one record is the same as using `find_by_key`.
The factory creating assignments automatically assigns a poll to it, so we don't use the poll for anything else, there's no need to explicitely create it.
The factories creating proposals and debates automatically create an author.
One test was testing regular users can't access results, and another one was testing neither regular users nor managers can. So the second test can just test the admin scenario, and we're still covering everything.
This data was added in commit 62088bc, but the changes in that commit don't seem to be related to the number of questions in a poll.
Questions are automatically created by the poll_question_answer factory.
@@ -434,8 +434,7 @@ | |||
|
|||
scenario "Display links to vote on groups with no investments voted yet" do | |||
group = create(:budget_group, budget: budget) | |||
heading = create(:budget_heading, name: "District 1", group: group, price: 100) | |||
|
|||
heading = create(:budget_heading, group: group, price: 100) |
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.
Lint/UselessAssignment: Useless assignment to variable - heading. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
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.
Thanks! Will remove it in a different pull request.
The "name" attribute is automatically generated by the budget heading factory. And the "price" attribute is out of context and not needed since this test doesn't create investments.
61dbed0
to
01862d6
Compare
…code Remove redundant code
References
Objectives
I18nContent
model