Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
fix sbposts controller test, remove closed beta mode stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
bborn committed Feb 16, 2011
1 parent a132e17 commit 20c81af
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 111 deletions.
34 changes: 14 additions & 20 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
= TODO
* replace paginating find with will paginate
* replace att_fu with paperclip
# * replace paginating find with will paginate
# * replace att_fu with paperclip
* rip out multiple uploader, responds-to-parent
* replace white_list with something (sanitize?) (preserve stuff from white list initializer)
* replace setup template with something else more sensible
* fix boot; allow overriding initializers, autoloading assets, etc
* mce_opts initializer, recaptcha constants
* rip out beta mode and teaser stuff
* clean up routes
* remove all the theming stuff
* take out ez where
* fix initializers/rakismet, recaptcha etc.
* take out vendors/offerings crap
* go back and fix: Rails 3 Fix comments
* searchlogic broken with rails 3 gem 'searchlogic', :git => git://github.com/railsdog/searchlogic.git
* copy new migrations from main app back into ce
* copy new gemfile from main app back into ce
# * fix boot;
* allow overriding initializers, autoloading assets, etc
* mce_opts initializer
# * recaptcha constants
# * rip out beta mode and teaser stuff
# * clean up routes
* remove all the theming stuff?
# * take out ez where
* fix rakismet initializer
* take out vendors/offerings stuff
* add back searching to users index, use metaseach
# * remote_form_for is gone (use dynamic_form gem)
* remove stylesheet customization
* rework users index to use searchlogic/metaseach or something
* remove stylesheet customization?
* use aato instead of aatos
* authlogic has problems: not sure it's recording last_login magic columns, investigate
# * finding transparently by login is broken (fixed using friendly_id)
# * can't dup nilclass error in Rails timezone conversion (fixed with a little patch, should get fixed in a new version of Rails)

# Bug in rails fixtures.rb on 849 - use fixtures_path.to_s.size instead


GOTCHAS:
* edge rails needs edge rack? and edge arel

=1.2.1
* Anonymous forum replies
* Turn comment notifications on or off by post
Expand Down
1 change: 0 additions & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ def index
def new
redirect_to user_path(current_user) and return if current_user
@user_session = UserSession.new
render :layout => 'beta' if configatron.closed_beta_mode
end

def create
Expand Down
13 changes: 0 additions & 13 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ class UsersController < BaseController
include Viewable
cache_sweeper :taggable_sweeper, :only => [:activate, :update, :destroy]

if configatron.closed_beta_mode
skip_before_filter :beta_login_required, :only => [:new, :create, :activate]
before_filter :require_invitation, :only => [:new, :create]

def require_invitation
redirect_to home_path and return false unless params[:inviter_id] && params[:inviter_code]
redirect_to home_path and return false unless User.find(params[:inviter_id]).valid_invite_code?(params[:inviter_code])
end
end

uses_tiny_mce(:only => [:new, :create, :update, :edit, :welcome_about]) do
configatron.default_mce_options.merge({:editor_selector => "rich_text_editor"})
end
Expand Down Expand Up @@ -93,8 +83,6 @@ def new
@user = User.new( {:birthday => Date.parse((Time.now - 25.years).to_s) }.merge(params[:user] || {}) )
@inviter_id = params[:id]
@inviter_code = params[:code]

render :action => 'new', :layout => 'beta' and return if configatron.closed_beta_mode
end

def create
Expand Down Expand Up @@ -269,7 +257,6 @@ def create_friendship_with_inviter(user, options = {})
def signup_completed
@user = User.find(params[:id])
redirect_to home_path and return unless @user
render :action => 'signup_completed', :layout => 'beta' if configatron.closed_beta_mode
end

def welcome_photo
Expand Down
4 changes: 0 additions & 4 deletions app/helpers/base_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,6 @@ def more_user_comments_links(user = @user)
html.html_safe
end

def feature_enabled?(feature)
configatron.sections_enabled.include?(feature)
end

def show_footer_content?
return true #you can override this in your app
end
Expand Down
21 changes: 0 additions & 21 deletions app/views/base/teaser.html.haml

This file was deleted.

30 changes: 0 additions & 30 deletions app/views/layouts/beta.html.haml

This file was deleted.

3 changes: 1 addition & 2 deletions app/views/sessions/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
-unless configatron.closed_beta_mode
.yui-b.sidebar=render :partial => 'shared/login_sidebar'
.yui-b.sidebar=render :partial => 'shared/login_sidebar'

#yui-main
.yui-b.main_column
Expand Down
9 changes: 3 additions & 6 deletions app/views/shared/_admin_nav.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@

%ul.list
%li= link_to_unless_current :features.l, homepage_features_path
- if feature_enabled?('categories')
%li= link_to_unless_current :categories.l, categories_path
%li= link_to_unless_current :categories.l, categories_path
%li= link_to_unless_current :metro_areas.l, metro_areas_path
- if feature_enabled?('skills')
%li= link_to_unless_current :skills.l, new_skill_path
- if feature_enabled?('events')
%li= link_to_unless_current :events.l, admin_events_path
%li= link_to_unless_current :skills.l, new_skill_path
%li= link_to_unless_current :events.l, admin_events_path
%li= link_to_unless_current :statistics.l, statistics_path
%li= link_to_unless_current :ads.l, ads_path
%li= link_to_unless_current :comments.l, admin_comments_path
Expand Down
2 changes: 0 additions & 2 deletions config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ community_description: "The Best Place for People Who Love Communities"
support_email: "support@community.com"
meta_description: 'A description of your community for use in META tags.'
meta_keywords: 'keywords for use in META tags'
sections_enabled: ['photos', 'posts', 'clippings', 'categories', 'events']
closed_beta_mode: false

# Comment this out if you want to infer the locale
# off of the http headers
Expand Down
4 changes: 0 additions & 4 deletions lib/community_engine/authenticated_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ def login_required
logged_in? && authorized? ? true : access_denied
end

def beta_login_required
login_required
end

def require_user
unless current_user
store_location
Expand Down
5 changes: 0 additions & 5 deletions test/functional/base_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,4 @@ def test_should_get_footer_content
assert_response :success
end

def test_should_get_teaser
get :teaser
assert_response :success
end

end
7 changes: 4 additions & 3 deletions test/functional/sb_posts_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,17 @@ def test_disallow_new_post_to_locked_topic
configatron.allow_anonymous_forum_posting = true
assert_difference SbPost, :count, 1 do
post :create, :forum_id => forums(:rails).to_param, :topic_id => topics(:pdi).to_param, :post => { :body => 'blah', :author_email => 'foo@bar.com' }
assert_redirected_to :controller => "topics", :action => "show", :forum_id => forums(:rails).to_param, :id => topics(:pdi).to_param
assert_redirected_to :controller => "topics", :action => "show", :forum_id => forums(:rails).to_param, :id => topics(:pdi).to_param, :anchor => assigns(:post).dom_id, :page => '1'
end
configatron.allow_anonymous_forum_posting = false
end

test "should fail creating an anonymous reply" do
configatron.allow_anonymous_forum_posting = true
assert_difference SbPost, :count, 0 do
post :create, :forum_id => forums(:rails).to_param, :topic_id => topics(:pdi).to_param, :post => { :body => 'blah', :author_email => 'foo' }
assert_response :redirect
post_params = { :body => 'blah', :author_email => 'foo' }
post :create, :forum_id => forums(:rails).to_param, :topic_id => topics(:pdi).to_param, :post => post_params
assert_redirected_to forum_topic_path({:forum_id => forums(:rails).to_param, :id => topics(:pdi).to_param, :anchor => 'reply-form', :page => '1'}.merge({:post => post_params}))
end
configatron.allow_anonymous_forum_posting = false
end
Expand Down

0 comments on commit 20c81af

Please sign in to comment.