Sha256: e21e86816c653a6c57ab322b8a9db1294dd560de52318e8da40b92a5100b4b4a

Contents?: true

Size: 1.7 KB

Versions: 8

Compression:

Stored size: 1.7 KB

Contents

$:.reject! { |e| e.include? 'TextMate' }
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
gem 'muck-engine'
require 'muck_test_helper'
require 'authlogic/test_case'
require 'active_record/fixtures'
require File.expand_path(File.dirname(__FILE__) + '/factories')

class ActiveSupport::TestCase
  include MuckTestMethods
  include Authlogic::TestCase
  self.use_transactional_fixtures = true
  self.use_instantiated_fixtures  = true

  TEST_URI = 'http://www.engadget.com'
  TEST_RSS_URI = 'http://www.engadget.com/rss.xml'
  TEST_USERNAME_TEMPLATE = 'http://feeds.delicious.com/v2/rss/{username}?count=100'
  
end


# Used to add in a music service since services.yml doesn't currently have any.
def build_music_service
  # We don't have any music services in the default services.yml so we build one here
  template = "http://example.com/{tag}.rss"
  uri_template = "http://example.com/{tag}"
  service_category = Factory(:service_category, :name => 'Music')
  Factory(:service, :uri_data_template => template, :uri_template => uri_template,  :use_for => 'tags', :service_category_id => service_category.id)
end
  
# load in the default data required to run the app
def bootstrap_services
  ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
  
  ServiceCategory.delete_all
  yml = File.join(File.dirname(__FILE__), '..', '..', '..', 'db', 'bootstrap',"service_categories")
  Fixtures.new(Service.connection,"service_categories",ServiceCategory,yml).insert_fixtures
  
  Service.delete_all
  yml = File.join(File.dirname(__FILE__), '..', '..', '..', 'db', 'bootstrap',"services")
  Fixtures.new(Service.connection,"services",Service,yml).insert_fixtures
  
end

bootstrap_services

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
muck-services-0.1.34 test/rails_root/test/test_helper.rb
muck-services-0.1.33 test/rails_root/test/test_helper.rb
muck-services-0.1.32 test/rails_root/test/test_helper.rb
muck-services-0.1.31 test/rails_root/test/test_helper.rb
muck-services-0.1.30 test/rails_root/test/test_helper.rb
muck-services-0.1.29 test/rails_root/test/test_helper.rb
muck-services-0.1.28 test/rails_root/test/test_helper.rb
muck-services-0.1.27 test/rails_root/test/test_helper.rb