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

22 lines
451 B
Ruby
Raw Normal View History

2016-09-24 03:00:46 +00:00
# frozen_string_literal: true
2017-11-06 16:15:18 +00:00
# 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