Permalink
Browse files

Changes to allow runing of program:

 - use sqlite instead of mysql
 - running rake test ( w/ some failures in test:functionals, but at least running.. )
 - script/server runs
 - script/db_free_run runs (somewhat - hardly tested)
  • Loading branch information...
1 parent d215d8f commit a1040254eb802f5ae971c6e9b8527ae5f9f5459e @deanius committed Jul 8, 2010
View
@@ -11,3 +11,4 @@ doc/app/*
doc/plugins/*
*database.yml*
/tmp/spec_server.pid
+db/*.sqlite3
View
@@ -9,7 +9,7 @@ require 'rake/rdoctask'
require 'tasks/rails'
-require 'metric_fu'
+# require 'metric_fu'
# not merging with rails own predefined rake task yet..
# GOAL: Eventually report on JS, comments, etc, through extensible lambda-based infrastructure
@@ -29,6 +29,7 @@ def authorize
# that sometimes facebook_session is nil in test mode. We'll extend the definition for now to
# also allow for hacked-on fb_sig_user as well
def is_facebook?
+ return false unless defined? facebook_session
!! ( facebook_session || params[:fb_sig_user] )
end
@@ -40,7 +41,10 @@ def player_in_session
# if accessed over facebook, the player referenced
def player_in_facebook
- fb_id = facebook_session ? facebook_session.user.id : params[:fb_sig_user]
+ fb_id = nil
+ if defined? facebook_session
+ fb_id = facebook_session ? facebook_session.user.id : params[:fb_sig_user]
+ end
return unless fb_id
fbuser = Fbuser.find_by_facebook_user_id(fb_id)
return fbuser.playing_as if fbuser
View
@@ -1,20 +1,24 @@
# SQL Server
development:
- adapter: mysql
- host: localhost
- database: chessonrails_development
- username: chessonrails
- password: ch3550nrails
+ adapter: sqlite3
+ database: db/development.sqlite3
+
+ # adapter: mysql
+ # host: localhost
+ # database: chessonrails_development
+ # username: chessonrails
+ # assword: ch3550nrails
test:
- #use either sqllite section or mysql
- #adapter: sqlite3
- #database: ":memory:"
- #verbosity: quiet
+ # use either sqllite section or mysql
+ # database: ":memory:" once worked (sigh..)
+ database: db/test.sqlite3
+ adapter: sqlite3
+ verbosity: quiet
- adapter: mysql
- host: localhost
- database: chessonrails_test
- username: chessonrails
- password: ch3550nrails
+ # adapter: mysql
+ # host: localhost
+ # database: chessonrails_test
+ # username: chessonrails
+ # password: ch3550nrails
View
@@ -5,7 +5,7 @@
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '= 2.2.2' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '>= 2.2.2' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
@@ -22,4 +22,4 @@
config.action_mailer.delivery_method = :test
require 'ruby-debug'
-require 'ruby-prof'
+# require 'ruby-prof'
@@ -6,7 +6,8 @@ def self.up
t.timestamps
end
- execute("alter table fbusers modify facebook_user_id bigint")
+ # this line is problematic when database is not supportive of bigint (ie sqlite)
+ # execute("alter table fbusers modify facebook_user_id bigint")
end
def self.down
View
@@ -20,7 +20,7 @@
end
create_table "fbusers", :force => true do |t|
- t.integer "facebook_user_id", :limit => 8
+ t.integer "facebook_user_id", :null => false
t.integer "playing_as"
t.datetime "created_at"
t.datetime "updated_at"
View
@@ -4,13 +4,14 @@ module DbFreeIncludes
rubygems
irb/completion
logger
- util
active_record_mock
- spec/db_free_spec_helper
chess_fixtures
chess_active_record_mock
}
+ # util - No util.rb found in project; deleted.
+ # spec/db_free_spec_helper - not needed for script/db_free_run and erring; deleted.
+
IRB_LOAD_PATHS = %w{
lib
spec/mocks
View
@@ -5,7 +5,7 @@
#allow spec command-line to run our files
require 'spec'
-class Test::Unit::TestCase
+class ActiveSupport::TestCase
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion. This ensures that the
# test database remains unchanged so your fixtures don't have to be reloaded

0 comments on commit a104025

Please sign in to comment.