Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4ee1708

Browse files
sinisterchipmunkpicandocodigo
authored andcommitted
Test that the model namespace isn't polluted.
The goal of ClassMethodsProxy is to avoid polluting the target's namespace, but it was possible to do this by accident when calling `class_eval` before ActiveSupport was completely loaded. This test ensures the namespace isn't polluted, regardless of the load state of ActiveSupport.
1 parent 33aa4bb commit 4ee1708

File tree

1 file changed

+4
-0
lines changed
  • elasticsearch-model/spec/elasticsearch/model/adapters/active_record

1 file changed

+4
-0
lines changed

‎elasticsearch-model/spec/elasticsearch/model/adapters/active_record/import_spec.rb‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
it 'imports all documents' do
5353
expect(ImportArticle.search('*').results.total).to eq(10)
5454
end
55+
56+
it "does not pollute the model's namespace" do
57+
expect(ImportArticle.methods).not_to include(:__transform)
58+
end
5559
end
5660

5761
context 'when batch size is specified' do

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /