Module: Frill::RSpec::Helpers

Defined in:
lib/frill/rspec.rb

Instance Method Summary collapse

Instance Method Details

#frill(model, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/frill/rspec.rb', line 4

def frill model, options={}
  view_context = ApplicationController.new.view_context.tap do |context|
    context.controller.request ||= ActionController::TestRequest.new options
    context.request            ||= context.controller.request
    context.params             ||= {}
  end

  Frill.decorate model, view_context, options
end