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

Hide related content proposals when these proposals are retired by their authors #4196

Merged
merged 7 commits into from
Oct 25, 2020
Merged

Hide related content proposals when these proposals are retired by their authors #4196

merged 7 commits into from
Oct 25, 2020

Conversation

matisnape
Copy link
Collaborator

References

#3559

Objectives

Hide retired proposals from "related content" section for show view for: debate, budget investment, proposal

Visual Changes

No changes

Notes

Not applicable

app/controllers/proposals_controller.rb Outdated Show resolved Hide resolved
app/controllers/management/proposals_controller.rb Outdated Show resolved Hide resolved
app/controllers/debates_controller.rb Outdated Show resolved Hide resolved
app/controllers/debates_controller.rb Outdated Show resolved Hide resolved
app/controllers/budgets/investments_controller.rb Outdated Show resolved Hide resolved
app/controllers/budgets/investments_controller.rb Outdated Show resolved Hide resolved
@javierm
Copy link
Member

javierm commented Oct 13, 2020

@matisnape Thanks for the pull request. Before reviewing, could you have a look at the failing tests?

@matisnape
Copy link
Collaborator Author

matisnape commented Oct 14, 2020

@matisnape Thanks for the pull request. Before reviewing, could you have a look at the failing tests?

@javierm Will do, of course.
However, when I run tests on my local master, I get 47 errors. Do you know what I might be missing in config? It's almost all Capybara errors or stuff like didn't find some text (from screenshots it looks like sleep is required). But there are some like this:

47) Budget Investments Search Advanced search Search by author type Public employee
      Failure/Error: investments = investments.filter(params[:advanced_search]) if params[:advanced_search].present?

      ArgumentError:
        wrong number of arguments (given 1, expected 0)

@javierm
Copy link
Member

javierm commented Oct 15, 2020

@matisnape That's strange 🤔. Which Ruby version are you using? What's the content of the .ruby-version file?

@matisnape
Copy link
Collaborator Author

@javierm Yeah, I have 2.5.8 like in the readme. I think last year I had the same issue and just watched the tests touching the area I was working with.
Anyways, I fixed the tests I definitely broke and the build is green :)

@javierm
Copy link
Member

javierm commented Oct 19, 2020

That's strange, because the error you mentioned happens when using Ruby 2.6+ but doesn't happen with Ruby 2.5 or below. Anyway, I'll review the changes now that the tests pass.

@javierm javierm added this to Reviewing in Consul Democracy via automation Oct 19, 2020
Copy link
Member

@javierm javierm left a comment

Choose a reason for hiding this comment

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

@matisnape Nice! I completely misunderstood what the issue was about even though I read it several times 😅, but you got it right 👍.

Regarding the tests you mentioned, I think a test in the spec/models/related_content_spec.rb file should do the trick once we've moved the code to the Relationable concern.

app/controllers/budgets/investments_controller.rb Outdated Show resolved Hide resolved
@javierm javierm moved this from Reviewing to Doing in Consul Democracy Oct 19, 2020
@javierm javierm moved this from Doing to Reviewing in Consul Democracy Oct 21, 2020
Copy link
Member

@javierm javierm left a comment

Choose a reason for hiding this comment

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

Looks good! I'll do some final tests on Monday and merge if everything is OK.

Thanks a lot!

Consul Democracy automation moved this from Reviewing to Testing Oct 23, 2020
@javierm javierm merged commit 9bd012f into consuldemocracy:master Oct 25, 2020
Consul Democracy automation moved this from Testing to Release 1.3.0 Oct 25, 2020
@javierm javierm changed the title Hide related content proposals when these proposals are retired by their authors #3559 Hide related content proposals when these proposals are retired by their authors Mar 11, 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.

Hide related content proposals when these proposals are retired by their authors
3 participants