Skip to content

Commit

Permalink
Adding a test to demonstrate the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ProGM committed Feb 20, 2017
1 parent a52814c commit 73d5f90
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/acts_as_taggable_on/caching_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,29 @@
end
end

describe 'Cache methods initialization on new models' do
before(:all) do
ActiveRecord::Schema.define do
create_table :cache_methods_injected_models do |t|
t.string :cached_tag_list
end
end
ActiveRecord::Base.connection.execute(
'INSERT INTO cache_methods_injected_models VALUES (NULL, \'ciao\')'
)
class CacheMethodsInjectedModel < ActiveRecord::Base
acts_as_taggable
end
end
after(:all) { Object.send(:remove_const, :CacheMethodsInjectedModel) }

it 'cached_tag_list_on? get injected correctly' do
expect do
CacheMethodsInjectedModel.first.tag_list
end.not_to raise_error
end
end

describe 'CachingWithArray' do
pending '#TODO'
end
Expand Down

0 comments on commit 73d5f90

Please sign in to comment.