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

Show the page action for creating a new shipping method #5719

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Expand Up @@ -5,7 +5,7 @@
describe "Shipping Methods", :js, type: :feature do
before { sign_in create(:admin_user, email: 'admin@example.com') }

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