Created
July 30, 2018 20:27
-
-
Save Overbryd/3b162c28d3246cf7d8b871a67ad96162 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
diff --git a/elasticsearch-persistence/spec/repository/base_spec.rb b/elasticsearch-persistence/spec/repository/base_spec.rb | |
index fae1e7b..4a1fc4f 100644 | |
--- a/elasticsearch-persistence/spec/repository/base_spec.rb | |
+++ b/elasticsearch-persistence/spec/repository/base_spec.rb | |
@@ -321,4 +321,22 @@ describe Elasticsearch::Persistence::Repository::Base do | |
it_behaves_like 'a base repository' | |
end | |
+ | |
+ context 'when configuration changes on a descendant' do | |
+ let(:repository) { MyRepository } | |
+ let!(:old_class) { repository.superclass.klass } | |
+ let(:new_class) { Object } | |
+ | |
+ before do | |
+ repository.klass = new_class | |
+ end | |
+ | |
+ it 'applies to the descendant only' do | |
+ expect(repository.klass).to be(new_class) | |
+ end | |
+ | |
+ it 'does not apply to the base class' do | |
+ expect(repository.superclass.klass).to be(old_class) | |
+ end | |
+ end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment