mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 12:12:26 +08:00
69 specs fail in rails 4 now ...not too bad
This commit is contained in:
parent
33e3f123b4
commit
9e4b0df7ff
9
Gemfile
9
Gemfile
|
@ -10,8 +10,10 @@ module Bundler::SharedHelpers
|
|||
end
|
||||
end
|
||||
|
||||
def rails4?
|
||||
!!ENV["RAILS4"]
|
||||
module ::Kernel
|
||||
def rails4?
|
||||
!!ENV["RAILS4"]
|
||||
end
|
||||
end
|
||||
|
||||
if rails4?
|
||||
|
@ -36,6 +38,7 @@ if rails4?
|
|||
gem 'rails-observers'
|
||||
gem 'protected_attributes'
|
||||
gem 'actionpack-action_caching'
|
||||
gem 'seed-fu' , github: 'mbleigh/seed-fu'
|
||||
else
|
||||
# we had pain with the 3.2.13 upgrade so monkey patch the security fix
|
||||
# next time around we hope to upgrade
|
||||
|
@ -45,6 +48,7 @@ else
|
|||
# REVIEW EVERY RELEASE
|
||||
gem 'sprockets', git: 'https://github.com/SamSaffron/sprockets.git', branch: 'rails-compat'
|
||||
gem 'redis-rails'
|
||||
gem 'seed-fu'
|
||||
end
|
||||
|
||||
gem 'redis'
|
||||
|
@ -105,7 +109,6 @@ gem 'rest-client'
|
|||
gem 'rinku'
|
||||
gem 'sanitize'
|
||||
gem 'sass'
|
||||
gem 'seed-fu'
|
||||
gem 'sidekiq'
|
||||
gem 'sidekiq-failures'
|
||||
gem 'sinatra', require: nil
|
||||
|
|
|
@ -17,6 +17,14 @@ GIT
|
|||
redis-activesupport (>= 3.2.3)
|
||||
redis-store (~> 1.1.0)
|
||||
|
||||
GIT
|
||||
remote: git://github.com/mbleigh/seed-fu.git
|
||||
revision: f89ea306472c500ec7911c7be111a4aad9c1bc78
|
||||
specs:
|
||||
seed-fu (2.2.0)
|
||||
activerecord (>= 3.1, < 4.1)
|
||||
activesupport (>= 3.1, < 4.1)
|
||||
|
||||
GIT
|
||||
remote: https://github.com/CodeMonkeySteve/fast_xor.git
|
||||
revision: 85b79ec6d116f9680f23bd2c5c8c2c2039d477d8
|
||||
|
@ -398,8 +406,6 @@ GEM
|
|||
railties (>= 4.0.0.beta, < 5.0)
|
||||
sass (>= 3.1.10)
|
||||
sprockets-rails (~> 2.0.0)
|
||||
seed-fu (1.2.3)
|
||||
rails (>= 2.1)
|
||||
shoulda (3.5.0)
|
||||
shoulda-context (~> 1.0, >= 1.0.1)
|
||||
shoulda-matchers (>= 1.4.1, < 3.0)
|
||||
|
@ -547,7 +553,7 @@ DEPENDENCIES
|
|||
sanitize
|
||||
sass
|
||||
sass-rails
|
||||
seed-fu
|
||||
seed-fu!
|
||||
shoulda
|
||||
sidekiq
|
||||
sidekiq-failures
|
||||
|
|
|
@ -51,7 +51,11 @@ class Topic < ActiveRecord::Base
|
|||
self.title = TextCleaner.clean_title(TextSentinel.title_sentinel(title).text) if errors[:title].empty?
|
||||
end
|
||||
|
||||
serialize :meta_data, ActiveRecord::Coders::Hstore
|
||||
if rails4?
|
||||
store_accessor :meta_data
|
||||
else
|
||||
serialize :meta_data, ActiveRecord::Coders::Hstore
|
||||
end
|
||||
|
||||
belongs_to :category
|
||||
has_many :posts
|
||||
|
|
|
@ -93,7 +93,7 @@ module Discourse
|
|||
# dumping rack lock cause the message bus does not work with it (throw :async, it catches Exception)
|
||||
# see: https://github.com/sporkrb/spork/issues/66
|
||||
# rake assets:precompile also fails
|
||||
config.threadsafe! unless $PROGRAM_NAME =~ /spork|rake/
|
||||
config.threadsafe! unless rails4? || $PROGRAM_NAME =~ /spork|rake/
|
||||
|
||||
# route all exceptions via our router
|
||||
config.exceptions_app = self.routes
|
||||
|
|
|
@ -7,7 +7,8 @@ Discourse::Application.configure do
|
|||
config.cache_classes = false
|
||||
|
||||
# Log error messages when you accidentally call methods on nil.
|
||||
config.whiny_nils = true
|
||||
config.whiny_nils = true unless rails4?
|
||||
config.eager_load = false if rails4?
|
||||
|
||||
# Show full error reports and disable caching
|
||||
config.consider_all_requests_local = true
|
||||
|
|
|
@ -49,9 +49,8 @@ Spork.prefork do
|
|||
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
||||
|
||||
|
||||
|
||||
# let's not run seed_fu every test
|
||||
SeedFu.quiet = true
|
||||
SeedFu.quiet = true if SeedFu.respond_to? :quiet
|
||||
SeedFu.seed
|
||||
|
||||
RSpec.configure do |config|
|
||||
|
|
Loading…
Reference in New Issue
Block a user