From 422958ed6f13fcd5c1cfc291b18a736fba1f6aa8 Mon Sep 17 00:00:00 2001 From: Eduardo Date: Sun, 2 Aug 2020 20:02:36 -0300 Subject: [PATCH] create specific spec for order links partial --- .../spree/admin/orders/edit.html.haml_spec.rb | 11 --------- .../shared/_order_links.html.haml_spec.rb | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 spec/views/spree/admin/shared/_order_links.html.haml_spec.rb diff --git a/spec/views/spree/admin/orders/edit.html.haml_spec.rb b/spec/views/spree/admin/orders/edit.html.haml_spec.rb index 6e099d27c7..b33cd187ef 100644 --- a/spec/views/spree/admin/orders/edit.html.haml_spec.rb +++ b/spec/views/spree/admin/orders/edit.html.haml_spec.rb @@ -35,15 +35,4 @@ describe "spree/admin/orders/edit.html.haml" do expect(rendered).to have_content("Order Total $36.00") end end - - describe "actions dropwdown" do - it "contains all the actions buttons" do - render - - expect(rendered).to have_content("Resend Confirmation") - expect(rendered).to have_content("Send Invoice") - expect(rendered).to have_content("Print Invoices") - expect(rendered).to have_content("Cancel Order") - end - end end diff --git a/spec/views/spree/admin/shared/_order_links.html.haml_spec.rb b/spec/views/spree/admin/shared/_order_links.html.haml_spec.rb new file mode 100644 index 0000000000..63b7be6339 --- /dev/null +++ b/spec/views/spree/admin/shared/_order_links.html.haml_spec.rb @@ -0,0 +1,24 @@ +require "spec_helper" + +describe "spree/admin/shared/_order_links.html.haml" do + helper Spree::BaseHelper # required to make pretty_time work + + around do |example| + original_config = Spree::Config[:enable_invoices?] + example.run + Spree::Config[:enable_invoices?] = original_config + end + + before do + order = create(:completed_order_with_fees) + assign(:order, order) + end + + describe "actions dropwdown" do + it "contains all the actions buttons" do + render + + expect(rendered).to have_content("links-dropdown") + end + end +end