Skip to content

Commit

Permalink
remove address book specs/plugin
Browse files Browse the repository at this point in the history
Test plan: specs pass

Change-Id: Id3394d6da6c738db078754c97398eb5112458550
Reviewed-on: https://gerrit.instructure.com/205138
Tested-by: Jenkins
Reviewed-by: Steven Burnett <[email protected]>
QA-Review: Steven Burnett <[email protected]>
Product-Review: Cameron Matheson <[email protected]>
  • Loading branch information
cmatheson committed Aug 20, 2019
1 parent d43c538 commit ed30b3d
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 571 deletions.
28 changes: 0 additions & 28 deletions app/views/plugins/_address_book_settings.html.erb

This file was deleted.

11 changes: 1 addition & 10 deletions lib/address_book.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
module AddressBook
STRATEGIES = {
'messageable_user' => { implementation: AddressBook::MessageableUser, label: lambda{ I18n.t('MessageableUser library') } }.freeze,
'microservice' => { implementation: AddressBook::Service, label: lambda{ I18n.t('AddressBook microservice') } }.freeze,
'performance_tap' => { implementation: AddressBook::PerformanceTap, label: lambda{ I18n.t('AddressBook performance tap') } }.freeze,
'empty' => { implementation: AddressBook::Empty, label: lambda{ I18n.t('Empty stub (for testing only)') } }.freeze
}.freeze
DEFAULT_STRATEGY = 'messageable_user'

Expand All @@ -35,13 +32,7 @@ def self.registry

# choose the implementation of address book according to the plugin setting
def self.strategy
strategy = Canvas::Plugin.find('address_book').settings[:strategy]
unless STRATEGIES.has_key?(strategy)
# plugin setting specifies an invalid strategy. (TODO: logger.warn or
# something.) gracefully fall back on default
strategy = DEFAULT_STRATEGY
end
strategy
DEFAULT_STRATEGY
end

def self.implementation
Expand Down
28 changes: 0 additions & 28 deletions lib/canvas/plugins/address_book.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/canvas/plugins/default_plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,3 @@
settings: { access_key: nil },
settings_partial: 'plugins/unsplash_settings'
})
require_dependency 'canvas/plugins/address_book'
29 changes: 0 additions & 29 deletions lib/canvas/plugins/validators/address_book_validator.rb

This file was deleted.

14 changes: 0 additions & 14 deletions spec/lib/address_book_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@
describe AddressBook do
describe "for" do
it "returns an instance of AddressBook::MessageableUser for 'messageable_user' strategy" do
plugin = double(settings: {strategy: 'messageable_user'})
allow(Canvas::Plugin).to receive(:find).and_return(plugin)
expect(AddressBook.for(user_model)).to be_a(AddressBook::MessageableUser)
end

it "returns an instance of AddressBook::Empty for 'empty' strategy" do
plugin = double(settings: {strategy: 'empty'})
allow(Canvas::Plugin).to receive(:find).and_return(plugin)
expect(AddressBook.for(user_model)).to be_a(AddressBook::Empty)
end

it "defaults to an instance of AddressBook::MessageableUser for invalid strategy" do
plugin = double(settings: {strategy: 'invalid'})
allow(Canvas::Plugin).to receive(:find).and_return(plugin)
expect(AddressBook.for(user_model)).to be_a(AddressBook::MessageableUser)
end

Expand Down
Loading

0 comments on commit ed30b3d

Please sign in to comment.