Skip to content

Commit

Permalink
Fix the intermittent test: missing attribute:: scope 1
Browse files Browse the repository at this point in the history
Reset all cached information about columns after defining the model to prevent old columns from leaking for other tests.

e.g.: https://travis-ci.org/thoughtbot/shoulda-matchers/jobs/622356910
  • Loading branch information
vsppedro authored and mcmire committed Feb 17, 2020
1 parent 0b23942 commit ad4dcf0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions spec/support/unit/helpers/model_builder.rb
Expand Up @@ -71,6 +71,7 @@ def define_model(name, columns = {}, options = {}, &block)
options,
&block
)
model.reset_column_information
defined_models << model
model
end
Expand All @@ -87,10 +88,6 @@ def clear_column_caches
DevelopmentRecord.connection_pool.clear_cache!
ProductionRecord.connection_pool.clear_cache!
end

defined_models.each do |model|
model.reset_column_information
end
end

def drop_created_tables
Expand Down

0 comments on commit ad4dcf0

Please sign in to comment.