2012-03-12 23:09:21 +00:00
|
|
|
require 'spec_helper'
|
2011-02-04 04:13:41 +00:00
|
|
|
|
|
|
|
describe Impressionist do
|
2013-07-06 19:20:35 +00:00
|
|
|
let(:imp) { RUBY_VERSION.match("1.8") ? "is_impressionable" : :is_impressionable }
|
|
|
|
|
2020-07-20 13:35:41 +00:00
|
|
|
it "is extended from ActiveRecord::Base" do
|
2013-07-06 19:20:35 +00:00
|
|
|
expect(ActiveRecord::Base).to respond_to(imp)
|
2020-07-20 13:35:41 +00:00
|
|
|
# ActiveRecord::Base.methods.include?(method).should be_truthy
|
2011-02-04 04:13:41 +00:00
|
|
|
end
|
2012-03-06 21:42:28 +00:00
|
|
|
|
2020-07-20 13:35:41 +00:00
|
|
|
it "includes methods in ApplicationController" do
|
2011-02-13 19:18:34 +00:00
|
|
|
method = RUBY_VERSION.match("1.8") ? "impressionist" : :impressionist
|
2013-07-06 19:20:35 +00:00
|
|
|
expect(ApplicationController).to respond_to(method)
|
2011-02-04 04:13:41 +00:00
|
|
|
end
|
2012-03-06 21:42:28 +00:00
|
|
|
|
2020-07-20 13:35:41 +00:00
|
|
|
it "includes the before_action method in ApplicationController" do
|
|
|
|
filters = ApplicationController._process_action_callbacks.select { |c| c.kind == :before }
|
|
|
|
|
|
|
|
expect(filters.collect(&:filter)).to include(:impressionist_app_filter)
|
2011-02-04 04:13:41 +00:00
|
|
|
end
|
2012-03-06 21:42:28 +00:00
|
|
|
end
|