From c35b330d25cfc062115d26dbd29a2d73ff6cda55 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Thu, 6 Aug 2020 11:15:22 +0100 Subject: [PATCH] Fix taxon_spec --- spec/models/spree/taxon_spec.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/spec/models/spree/taxon_spec.rb b/spec/models/spree/taxon_spec.rb index bf1dbe6e1c..135b512cd3 100644 --- a/spec/models/spree/taxon_spec.rb +++ b/spec/models/spree/taxon_spec.rb @@ -54,36 +54,36 @@ module Spree context "set_permalink" do it "should set permalink correctly when no parent present" do taxon.set_permalink - taxon.permalink.should == "ruby-on-rails" + expect(taxon.permalink).to eq "ruby-on-rails" end it "should support Chinese characters" do taxon.name = "你好" taxon.set_permalink - taxon.permalink.should == 'ni-hao' + expect(taxon.permalink).to eq 'ni-hao' end context "with parent taxon" do before do taxon.stub parent_id: 123 - taxon.stub parent: mock_model(Spree::Taxon, permalink: "brands") + taxon.stub parent: build(:taxon, permalink: "brands") end it "should set permalink correctly when taxon has parent" do taxon.set_permalink - taxon.permalink.should == "brands/ruby-on-rails" + expect(taxon.permalink).to eq "brands/ruby-on-rails" end it "should set permalink correctly with existing permalink present" do taxon.permalink = "b/rubyonrails" taxon.set_permalink - taxon.permalink.should == "brands/rubyonrails" + expect(taxon.permalink).to eq "brands/rubyonrails" end it "should support Chinese characters" do taxon.name = "我" taxon.set_permalink - taxon.permalink.should == "brands/wo" + expect(taxon.permalink).to eq "brands/wo" end end end @@ -93,7 +93,6 @@ module Spree let(:taxonomy) { create(:taxonomy) } it "does not error out" do - pending "breaks in Rails 4 with postgres, see https://github.com/rails/rails/issues/10995" expect { taxonomy.root.children.where(name: "Some name").first_or_create }.not_to raise_error end end