Skip to content

Commit

Permalink
Merge pull request #5719 from SuperGoodSoft/feature/solidus_admin/add…
Browse files Browse the repository at this point in the history
…-new-shipping-method-page-action

Show the page action for creating a new shipping method
  • Loading branch information
tvdeyen authored Apr 12, 2024
2 parents a2e1519 + f0b12fb commit 8a5b257
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def search_key
:name_or_description_cont
end

def actions
def page_actions
render component("ui/button").new(
tag: :a,
text: t('.add'),
Expand Down
10 changes: 9 additions & 1 deletion admin/spec/features/shipping_methods_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
describe "Shipping Methods", :js, type: :feature do
before { sign_in create(:admin_user, email: '[email protected]') }

it "lists tax categories and allows deleting them" do
it "lists shipping methods and allows deleting them" do
create(:shipping_method, name: "FAAAST")

visit "/admin/shipping_methods"
Expand All @@ -14,9 +14,17 @@

select_row("FAAAST")
click_on "Delete"

expect(page).to have_content("Shipping methods were successfully removed.")
expect(page).not_to have_content("FAAAST")
expect(Spree::ShippingMethod.count).to eq(0)
expect(page).to be_axe_clean
end

it "shows the link for creating a new shipping method" do
visit "/admin/shipping_methods"

expect(page).to have_content("Add new")
expect(page).to have_selector(:css, 'a[href="/admin/shipping_methods/new"]')
end
end

0 comments on commit 8a5b257

Please sign in to comment.