2016-09-24 03:00:46 +00:00
|
|
|
# frozen_string_literal: true
|
2015-12-16 14:16:02 +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'
|
|
|
|
|
2015-12-16 14:16:02 +00:00
|
|
|
module ControllerHelpers
|
2016-09-21 17:22:40 +00:00
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
include Devise::Test::ControllerHelpers
|
|
|
|
end
|
|
|
|
|
|
|
|
def comparable(model)
|
|
|
|
model.attributes.except('id', 'created_at', 'updated_at')
|
2015-12-16 14:16:02 +00:00
|
|
|
end
|
|
|
|
end
|
2016-01-26 10:42:24 +00:00
|
|
|
|
|
|
|
RSpec.configure do |config|
|
2016-07-26 00:14:23 +00:00
|
|
|
config.include ControllerHelpers, type: :controller
|
2016-01-26 10:42:24 +00:00
|
|
|
end
|