-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
🥔✨ Marketplace
: #restore
Products
and DeliveryAreas
#2074
Conversation
visit(polymorphic_path(marketplace.location(child: :delivery_areas))) | ||
click_link("Archived Delivery Areas") | ||
within("##{dom_id(delivery_area)}") do | ||
click_link("Edit") |
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.
Is there any chance delivery area data persists/leaks across cases so you'd want to do click_link("Edit", :match => :first)
etc...?
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.
The within('##{dom_id(delivery_area)}') do ... end
scopes this click_link to child elements of the DOM element with the delivery area's ID. This should mitigate leakage across test case runs.
That said, leakage across test case runs are very unlikely to the point of "not worth worrying about" in most rails apps using RSpec because of rspec's transactional fixtures feature.
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.
OH right right I see that scope now. Coolio.
@@ -9,7 +9,7 @@ def create? | |||
alias_method :update?, :create? | |||
|
|||
def permitted_attributes(_) | |||
[:label, :price, :order_by, :delivery_window] | |||
[:label, :price, :order_by, :delivery_window, :restore] |
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.
Is it ruby/rails syntax convention to horizontally stack lists? I guess I've gotten used to left-aligned vertical lists for collections so I find them easier to scan that way. 😅
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.
Eh, it's kind of a "six in one half dozen in the other" for me. I can imagine there's legibility benefits to vertical lists rather than horizontal ones; and am happy to receive feedback or patches on a case-by-case basis for where it's useful; or even add linter rule if it's something we want to enforce more broadly.
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'll think about it 🤨
Marketplace
: RemovingDeliveryAreas
#2014Marketplace
:Selling Products
: ArchivingProducts
#2023This allows a
Product
andDeliveryArea
to be Restored; and also makes their forms look the same.