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

Fix admin promotions controller #5943

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Nov 19, 2024

Summary

Fix admin promotions index controller: visit the correct URL on row click, and authorize against the right model.

The  `authorization_subject` method from `solidus_admin` assumes that
all models are in the `Spree` namespace.
@mamhoff mamhoff requested a review from a team as a code owner November 19, 2024 08:53
@github-actions github-actions bot added changelog:solidus_admin changelog:solidus_promotions Changes to the solidus_promotions gem labels Nov 19, 2024
@mamhoff mamhoff force-pushed the fix-admin-promotions-controller branch from 0e66bf5 to 77126cc Compare November 19, 2024 08:55
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Thanks 👍🏻

The spec helper name is a bit misleading, though

admin/lib/solidus_admin/testing_support/feature_helpers.rb Outdated Show resolved Hide resolved
This controller still did not know how what to authorize against, and
wanted to visit a URL that doesn't exist when clicking on a promotion.

This also changes at least the name of each promotion to be a link
element that can easily be targeted with Capybara and works with all
major browsers.
@mamhoff mamhoff force-pushed the fix-admin-promotions-controller branch from 77126cc to 2eccd6d Compare November 19, 2024 09:24
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this

@tvdeyen tvdeyen added the backport-v4.4 Backport this pull-request to v4.4 label Nov 19, 2024
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.54%. Comparing base (825fb6d) to head (2eccd6d).
Report is 56 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5943   +/-   ##
=======================================
  Coverage   89.54%   89.54%           
=======================================
  Files         782      782           
  Lines       17991    17997    +6     
=======================================
+ Hits        16110    16116    +6     
  Misses       1881     1881           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tvdeyen tvdeyen merged commit e3b326a into solidusio:main Nov 19, 2024
18 checks passed
@tvdeyen
Copy link
Member

tvdeyen commented Dec 6, 2024

Backport after #6016

@tvdeyen tvdeyen added backport-v4.4 Backport this pull-request to v4.4 and removed backport-v4.4 Backport this pull-request to v4.4 labels Dec 6, 2024
Copy link

github-actions bot commented Dec 6, 2024

💚 All backports created successfully

Status Branch Result
v4.4

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v4.4 Backport this pull-request to v4.4 changelog:solidus_promotions Changes to the solidus_promotions gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants