metamaps--metamaps/spec/support/controller_helpers.rb

21 lines
450 B
Ruby
Raw Normal View History

2016-09-24 03:00:46 +00:00
# frozen_string_literal: true
# https://github.com/plataformatec/devise/wiki/How-To:-Stub-authentication-in-controller-specs
2016-01-26 10:42:24 +00:00
require 'devise'
module ControllerHelpers
extend ActiveSupport::Concern
included do
include Devise::Test::ControllerHelpers
end
def comparable(model)
model.attributes.except('id', 'created_at', 'updated_at')
end
end
2016-01-26 10:42:24 +00:00
RSpec.configure do |config|
config.include ControllerHelpers, type: :controller
2016-01-26 10:42:24 +00:00
end