Sha256: eaaed515b7d3adf0a86f862acd10e62210f8df95b1dcb1bec2c9c4c0e5a133a1
Contents?: true
Size: 1014 Bytes
Versions: 25
Compression:
Stored size: 1014 Bytes
Contents
require 'intercom-rails' require 'minitest/autorun' require 'rspec/mocks' require 'pry' def dummy_user(options = {}) user = Struct.new(:email, :name).new user.email = options[:email] || 'ben@intercom.io' user.name = options[:name] || 'Ben McRedmond' user end def dummy_company(options = {}) company = Struct.new(:id, :name).new company.id = options[:id] || '6' company.name = options[:name] || 'Intercom' company end def fake_action_view_class klass = Class.new(ActionView::Base) klass.class_eval do include IntercomRails::ScriptTagHelper attr_reader :controller end klass end class Object # any_instance.rspec_reset does not work def self.unstub_all_instance_methods public_instance_methods.each do |method| begin self.any_instance.unstub(method) rescue RSpec::Mocks::MockExpectationError next end end end end RSpec::Mocks::setup(Object.new) module InterTest def setup IntercomRails::Config.reset! super end end
Version data entries
25 entries across 25 versions & 1 rubygems