Skip to content

How To: Set default_url_options in cell spec

PikachuEXE edited this page Dec 30, 2013 · 1 revision
# spec_helper or some file that are required before cell spec
### Default params for Cells
module CellDefaultParams
  extend ActiveSupport::Concern

  included do
    before do # called before every it.
      @controller.instance_eval do
        def default_url_options(options={})
          { :locale => I18n.locale }
        end
      end
    end
  end
end

RSpec.configure do |config|
  config.include(CellDefaultParams, :type => :cell)
end
Clone this wiki locally