2011-02-04 04:13:41 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Impressionist do
|
|
|
|
it "should be extended from ActiveRecord::Base" do
|
2011-02-13 19:18:34 +00:00
|
|
|
method = RUBY_VERSION.match("1.8") ? "is_impressionable" : :is_impressionable
|
|
|
|
ActiveRecord::Base.methods.include?(method).should be true
|
2011-02-04 04:13:41 +00:00
|
|
|
end
|
2012-03-06 21:42:28 +00:00
|
|
|
|
2011-02-04 04:13:41 +00:00
|
|
|
it "should include methods in ApplicationController" do
|
2011-02-13 19:18:34 +00:00
|
|
|
method = RUBY_VERSION.match("1.8") ? "impressionist" : :impressionist
|
|
|
|
ApplicationController.instance_methods.include?(method).should be true
|
2011-02-04 04:13:41 +00:00
|
|
|
end
|
2012-03-06 21:42:28 +00:00
|
|
|
|
2011-02-04 04:13:41 +00:00
|
|
|
it "should include the before_filter method in ApplicationController" do
|
|
|
|
filters = ApplicationController._process_action_callbacks.select { |c| c.kind == :before }
|
|
|
|
filters.collect{|filter|filter.filter}.include?(:impressionist_app_filter).should be true
|
|
|
|
end
|
2012-03-06 21:42:28 +00:00
|
|
|
end
|