Skip to content

Commit

Permalink
Test breadcrumbs when coming from GTL page
Browse files Browse the repository at this point in the history
  • Loading branch information
ZitaNemeckova committed Jul 16, 2019
1 parent bd815c1 commit 1e6376c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/controllers/mixins/breadcrumbs_mixin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class TestMixin < ApplicationController
allow(mixin_explorer).to receive(:x_active_tree).and_return(:active_tree)
allow(mixin_explorer).to receive(:gtl_url).and_return("/show")
mixin_explorer.instance_variable_set(:@sb, {})
allow(mixin).to receive(:params).and_return({})

allow(mixin).to receive(:breadcrumbs_options).and_return(:breadcrumbs => [
{:title => _("First Layer")},
Expand Down Expand Up @@ -213,6 +214,17 @@ class TestMixin < ApplicationController
expect(mixin.special_page_breadcrumb(mixin.instance_variable_get(:@tagitems))).to eq(nil)
end
end

context "when coming from GTL page" do
before do
mixin.instance_variable_set(:@tagitems, [{:id => "1789", :description => "item"}])
allow(mixin).to receive(:params).and_return({:miq_grid_checks => "42"})
end

it "returns nil" do
expect(mixin.special_page_breadcrumb(mixin.instance_variable_get(:@tagitems))).to eq(nil)
end
end
end

describe "#ancestry_parents" do
Expand Down

0 comments on commit 1e6376c

Please sign in to comment.