Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

Commit

Permalink
Remove unused subject#view_for
Browse files Browse the repository at this point in the history
  • Loading branch information
xjunior committed Apr 6, 2021
1 parent aee80da commit be949ea
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
5 changes: 0 additions & 5 deletions lib/consent/subject.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,5 @@ def initialize(key, label)
@actions = []
@views = Consent.default_views.clone
end

def view_for(action, key)
view = @views.keys & action.view_keys & [key]
@views[view.first] || @views[action.default_view]
end
end
end
16 changes: 0 additions & 16 deletions spec/nitro/consent/subject_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,4 @@
expect(subject.views[:view1]).to be view
end
end

describe '#view_for' do
let(:all_view) { double }
let(:none_view) { double }
let(:action) { double(view_keys: %i[all none some], default_view: :some) }

before do
subject.views[:all] = all_view
subject.views[:none] = none_view
subject.actions << action
end

it 'is the view with the given key' do
expect(subject.view_for(action, :all)).to be all_view
end
end
end

0 comments on commit be949ea

Please sign in to comment.