-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add specs for display methods in ops controller for Tenant
Add also spec for updating view_options in nested_list in GenericShowMixin
- Loading branch information
Hilda Stastna
committed
Sep 11, 2019
1 parent
0fca858
commit 7cac717
Showing
2 changed files
with
131 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
describe Mixins::GenericShowMixin do | ||
class GenericShowMixinTestController < ActionController::Base | ||
include Mixins::GenericShowMixin | ||
end | ||
|
||
describe '#nested_list' do | ||
context 'displaying Service Templates thru Tenant textual summary' do | ||
let(:controller) { OpsController.new } | ||
let(:opts) do | ||
{ | ||
:association => :nested_service_templates, | ||
:parent => tenant, | ||
:no_checkboxes => true | ||
} | ||
end | ||
let(:tenant) { FactoryBot.create(:tenant) } | ||
|
||
before do | ||
allow(controller).to receive(:drop_breadcrumb) | ||
allow(controller).to receive(:show_link) | ||
allow(controller).to receive(:session).and_return(:view => nil) | ||
allow(controller).to receive(:render) | ||
controller.instance_variable_set(:@record, tenant) | ||
controller.params = {} | ||
end | ||
|
||
it 'updates view_options also with :no_checkboxes' do | ||
expect(controller).to receive(:get_view).with(ServiceTemplate, opts) | ||
controller.send(:nested_list, ServiceTemplate, opts.merge(:breadcrumb_title => 'Catalog Items and Bundles')) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters