Module: MuckPluginMacros
- Defined in:
- lib/test/shoulda_macros/plugins.rb
Instance Method Summary collapse
Instance Method Details
#should_act_as_list ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/test/shoulda_macros/plugins.rb', line 16 def should_act_as_list klass = self.name.gsub(/Test$/, '').constantize context "To support acts_as_list" do should_have_db_column('position', :type => :integer) end should "include ActsAsList methods" do assert klass.include?(ActiveRecord::Acts::List::InstanceMethods) end should_have_instance_methods :acts_as_list_class, :position_column, :scope_condition end |
#should_act_as_taggable_on_steroids ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/test/shoulda_macros/plugins.rb', line 3 def should_act_as_taggable_on_steroids klass = self.name.gsub(/Test$/, '').constantize should "include ActsAsTaggableOnSteroids methods" do assert klass.extended_by.include?(ActiveRecord::Acts::Taggable::ClassMethods) assert klass.extended_by.include?(ActiveRecord::Acts::Taggable::SingletonMethods) assert klass.include?(ActiveRecord::Acts::Taggable::InstanceMethods) end should_have_many :taggings, :tags end |