AO3-4547 Allow banner updates WITHOUT turning banner back on #2435
app/controllers/admin/banners_controller.rb
| @@ -43,7 +43,10 @@ def create | ||
| def update | ||
| @admin_banner = AdminBanner.find(params[:id]) | ||
| - if @admin_banner.update_attributes(params[:admin_banner]) | ||
| + if @admin_banner.update_attributes(params[:admin_banner]) && params[:admin_banner_minor_edit] |
|
There may be a neater way to do this. If so, I am all ears! Actually, doing it this way you'll be updating_attributes twice if it is not a minor edit. I suggest you flip it, ie:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
features/other_a/banner_general.feature
| +Scenario: Admin should not have option to make minor updates on banner that is not active | ||
| + Given there are no banners | ||
| + And an admin creates a banner | ||
| + When I am logged in as an admin | ||
| + And I am on the admin_banners page | ||
| + And I follow "Edit" | ||
| + Then I should not see "This is a minor update (Do not turn the banner back on for users who have dismissed it)" | ||
| + | ||
| +Scenario: Admin can make minor changes to the text of an active banner without turning it back on for users who have already dismissed it | ||
| + Given there are no banners | ||
| + And an admin creates an active banner | ||
| + And I am logged in as "banner_tester_3" with password "nobanners" | ||
| + And I set my preferences to turn off the banner showing on every page | ||
| + And an admin makes a minor edit to the active banner | ||
| + When I am logged in as "banner_tester_3" with password "nobanners" | ||
| + Then I should not see "This is some banner text!" |
|
This is nitpicky, but ideally you'd have the actual text in one file. What I mean is, either your earlier step should be "And an admin adds "This is some banner text!" to the active banner as a minor edit" and change the step definition to take custom text, or you should have this step should be "Then I should not see the minor edit" and make the step definition in the banner_steps file look for the text.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
1 check passed
Details
continuous-integration/travis-ci/pr
The Travis CI build passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://otwarchive.atlassian.net/browse/AO3-4547
We want to make it so admins can fix typos or update fundraising totals in admin banners without turning the banner back on instead of having to ask poor james to do it from the console.