Sha256: f24c9017efd688143eb5dfd2dbb9727fbf2a6dd1d78d109b47494848f0fd3183

Contents?: true

Size: 1.15 KB

Versions: 28

Compression:

Stored size: 1.15 KB

Contents

class ActiveSupport::TestCase
  def stub_paperclip!
    Paperclip::InstanceMethods.module_eval do
      def save_attached_files
        true
      end
    end
    Paperclip::Geometry.module_eval do
      def self.from_file(file)
        Paperclip::Geometry.new('20', '20')
      end
    end
  end
end

class ActionController::TestCase
  def set_company_host(company)
    @request.host = company.domain_name 
  end

  def setup_company_and_login_admin
    @company = Factory(:company)
    @user = @company.users.first
    set_company_host(@company)
  end

  def logout_user
    User.first.destroy
    #UserSession.find.try(:destroy)
  end
end

class ActionController::IntegrationTest
  FIXTURES_PATH = File.join(File.dirname(__FILE__), '..', 'fixtures') unless const_defined?('FIXTURES_PATH')

  def login_company(username, password)
  end

  def set_company_host(company)
    reset!
    host! company.domain_name
  end

  def read_fixture(action, options = nil)
    template = IO.readlines("#{FIXTURES_PATH}/liquid/#{action}").join
    if options
      vars = OpenStruct.new options
      ERB.new(template).result(vars.send(:binding))
    else
      template
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
liquid_cms-0.3.2.0 test/test_helpers/login_methods.rb
liquid_cms-0.2.2.0 test/test_helpers/login_methods.rb
liquid_cms-0.2.1.1 test/test_helpers/login_methods.rb
liquid_cms-0.3.1.0 test/test_helpers/login_methods.rb
liquid_cms-0.2.1.0 test/test_helpers/login_methods.rb
liquid_cms-0.2.0.13 test/test_helpers/login_methods.rb
liquid_cms-0.3.0.10 test/test_helpers/login_methods.rb
liquid_cms-0.3.0.9 test/test_helpers/login_methods.rb
liquid_cms-0.2.0.12 test/test_helpers/login_methods.rb
liquid_cms-0.2.0.11 test/test_helpers/login_methods.rb
liquid_cms-0.2.0.10 test/test_helpers/login_methods.rb
liquid_cms-0.3.0.8 test/test_helpers/login_methods.rb
liquid_cms-0.2.0.9 test/test_helpers/login_methods.rb
liquid_cms-0.3.0.7 test/test_helpers/login_methods.rb
liquid_cms-0.3.0.6 test/test_helpers/login_methods.rb
liquid_cms-0.2.0.8 test/test_helpers/login_methods.rb
liquid_cms-0.3.0.5 test/test_helpers/login_methods.rb
liquid_cms-0.2.0.7 test/test_helpers/login_methods.rb
liquid_cms-0.3.0.4 test/test_helpers/login_methods.rb
liquid_cms-0.2.0.6 test/test_helpers/login_methods.rb