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

20 lines
420 B
Ruby
Raw Normal View History

# 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