metamaps--metamaps/spec/support/controller_helpers.rb
2016-09-24 11:00:46 +08:00

20 lines
450 B
Ruby

# frozen_string_literal: true
# https://github.com/plataformatec/devise/wiki/How-To:-Stub-authentication-in-controller-specs
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
RSpec.configure do |config|
config.include ControllerHelpers, type: :controller
end