Fix feature specs added from spree_backend in the configuration area

This commit is contained in:
luisramos0
2019-09-17 18:51:10 +01:00
parent 44761315c2
commit 4f9eee2682
3 changed files with 9 additions and 6 deletions

View File

@@ -10,7 +10,7 @@
%table#listing_tax_categories.index
%colgroup
%col{style => "width: 30%"}/
%col{style: "width: 30%"}/
%col{style: "width: 40%"}/
%col{style: "width: 15%"}/
%col{style: "width: 15%"}/

View File

@@ -1,9 +1,10 @@
require 'spec_helper'
describe "Tax Categories" do
stub_authorization!
include AuthenticationWorkflow
before(:each) do
quick_login_as_admin
visit spree.admin_path
click_link "Configuration"
end

View File

@@ -1,18 +1,20 @@
require 'spec_helper'
describe "Tax Rates" do
stub_authorization!
include AuthenticationWorkflow
let!(:tax_rate) { create(:tax_rate, :calculator => stub_model(Spree::Calculator)) }
let!(:calculator) { create(:calculator_per_item, calculable: create(:order)) }
let!(:tax_rate) { create(:tax_rate, calculator: calculator) }
before do
quick_login_as_admin
visit spree.admin_path
click_link "Configuration"
end
# Regression test for #535
it "can see a tax rate in the list if the tax category has been deleted" do
tax_rate.tax_category.update_column(:deleted_at, Time.now)
tax_rate.tax_category.update_column(:deleted_at, Time.zone.now)
lambda { click_link "Tax Rates" }.should_not raise_error
within("table tbody td:nth-child(3)") do
page.should have_content("N/A")
@@ -23,7 +25,7 @@ describe "Tax Rates" do
it "can create a new tax rate" do
click_link "Tax Rates"
click_link "New Tax Rate"
fill_in "Rate", :with => "0.05"
fill_in "Rate", with: "0.05"
click_button "Create"
page.should have_content("Tax Rate has been successfully created!")
end