Skip to content

Commit

Permalink
Fix: stubbing rails application & removing of rails 2 specific code
Browse files Browse the repository at this point in the history
  • Loading branch information
Intrepidd committed Mar 2, 2014
1 parent cb0ea3d commit f273b84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
10 changes: 1 addition & 9 deletions lib/rails-footnotes/filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,7 @@ def performed_render?
end

def valid_format?
@controller.response.content_type == 'text/html'
end

def template_format_method
if @template.respond_to?(:template_format)
return 'template_format'
else
return 'format'
end
[:html,:rhtml,:xhtml,:rxhtml].include?(@template.send(:format).to_sym)
end

def valid_content_type?
Expand Down
13 changes: 7 additions & 6 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@
end

require 'rubygems'

require 'rails/all'
ENV['RAILS_ENV'] = 'test'
Rails.logger = Logger.new(STDOUT)

require 'active_support'
require 'active_support/all' unless Class.respond_to?(:cattr_accessor)
require 'rails-footnotes/footnotes'
require 'rails-footnotes/abstract_note'
require "rails-footnotes"

class Rails
def self.logger; end

def self.version; '3.0.12'; end
RSpec.configure do |config|
end

RSpec.configure do |config|
module FooBar
class Application < Rails::Application
config.secret_key_base = 'foobar'
end
end

0 comments on commit f273b84

Please sign in to comment.