Sha256: ea722c9c2dd4f43318c200e198b1dfec9c3762175a2a07c04fd9c3dcf24bf593

Contents?: true

Size: 661 Bytes

Versions: 24

Compression:

Stored size: 661 Bytes

Contents

module Locomotive
  module TestHelpers

    def request_site(site)
      @request.env['locomotive.site'] = site
    end

    def account_token(account)
      account.ensure_authentication_token
      account.save
      account.authentication_token
    end

  end
end

def Locomotive.configure_for_test(force = false)
  Locomotive.configure do |config|
    config.enable_logs = true

    config.enable_admin_ssl = false

    if force
      Locomotive.send(:remove_const, 'Site') if Locomotive.const_defined?('Site')
      load 'locomotive/site.rb'

      FactoryGirl.factories.clear
      load File.join(File.dirname(__FILE__), 'factories.rb')
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
locomotivecms-3.3.0 spec/support/locomotive.rb
locomotivecms-3.3.0.rc3 spec/support/locomotive.rb
locomotivecms-3.3.0.rc2 spec/support/locomotive.rb
locomotivecms-3.1.2 spec/support/locomotive.rb
locomotivecms-3.2.1 spec/support/locomotive.rb
locomotivecms-3.3.0.rc1 spec/support/locomotive.rb
locomotivecms-3.2.0 spec/support/locomotive.rb
locomotivecms-3.2.0.rc2 spec/support/locomotive.rb
locomotivecms-3.2.0.rc1 spec/support/locomotive.rb
locomotivecms-3.1.1 spec/support/locomotive.rb
locomotivecms-3.1.0 spec/support/locomotive.rb
locomotivecms-3.1.0.rc3 spec/support/locomotive.rb
locomotivecms-3.1.0.rc2 spec/support/locomotive.rb
locomotivecms-3.1.0.rc1 spec/support/locomotive.rb
locomotivecms-3.0.1 spec/support/locomotive.rb
locomotivecms-3.0.0 spec/support/locomotive.rb
locomotivecms-3.0.0.rc7 spec/support/locomotive.rb
locomotivecms-3.0.0.rc6 spec/support/locomotive.rb
locomotivecms-3.0.0.rc5 spec/support/locomotive.rb
locomotivecms-3.0.0.rc4 spec/support/locomotive.rb