From 20c81afb1c4f2c5e7dda5e3aa7562cea7e6b033f Mon Sep 17 00:00:00 2001 From: bborn Date: Wed, 16 Feb 2011 11:20:35 -0600 Subject: [PATCH] fix sbposts controller test, remove closed beta mode stuff --- CHANGELOG | 34 ++++++++------------ app/controllers/sessions_controller.rb | 1 - app/controllers/users_controller.rb | 13 -------- app/helpers/base_helper.rb | 4 --- app/views/base/teaser.html.haml | 21 ------------ app/views/layouts/beta.html.haml | 30 ----------------- app/views/sessions/new.html.haml | 3 +- app/views/shared/_admin_nav.html.haml | 9 ++---- config/application.yml | 2 -- lib/community_engine/authenticated_system.rb | 4 --- test/functional/base_controller_test.rb | 5 --- test/functional/sb_posts_controller_test.rb | 7 ++-- 12 files changed, 22 insertions(+), 111 deletions(-) delete mode 100755 app/views/base/teaser.html.haml delete mode 100755 app/views/layouts/beta.html.haml diff --git a/CHANGELOG b/CHANGELOG index 0063213b..128c4520 100755 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 4dcb4a04..15b67c12 100755 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -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 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 677d2c6f..6014ba4d 100755 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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 @@ -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 @@ -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 diff --git a/app/helpers/base_helper.rb b/app/helpers/base_helper.rb index 570074c6..75c880cd 100644 --- a/app/helpers/base_helper.rb +++ b/app/helpers/base_helper.rb @@ -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 diff --git a/app/views/base/teaser.html.haml b/app/views/base/teaser.html.haml deleted file mode 100755 index c493b168..00000000 --- a/app/views/base/teaser.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -=render :partial => 'base/homepage_banner_message' - -#login - = form_tag sessions_path, :class => "MainForm" do - %label{"for"=>"username"} - =:username.l - \: - = text_field_tag 'login', nil, :size => 35 - - %label{"for"=>"password"} - =:password.l - \: - = password_field_tag 'password', nil, :size => 35 - - %fieldset - %label{"for"=>"remember_me"} - =:remember_me.l - \: - = check_box_tag 'remember_me' - - %p= submit_tag :log_in.l diff --git a/app/views/layouts/beta.html.haml b/app/views/layouts/beta.html.haml deleted file mode 100755 index b2eb8752..00000000 --- a/app/views/layouts/beta.html.haml +++ /dev/null @@ -1,30 +0,0 @@ -!!! -%html -%head - %link{:rel=>"shortcut icon", :href=>"#{home_url}favicon.ico"} - %meta{"http-equiv"=>"Content-Type", :content=>"text/html;charset=utf-8"} - - %title - = configatron.community_name - | - = configatron.community_tagline - - = render :partial => "shared/scripts_and_styles" - - %body - #doc2.yui-t6 - #hd - %h1 - %a{:href=>home_url, :title=>"#{configatron.community_name}"}= configatron.community_name - - #NavBar - %ul - - #bd - = render :partial => "shared/messages" - - = @content_for_layout - - #ft - #CommunityFooter - %p= configatron.community_tagline diff --git a/app/views/sessions/new.html.haml b/app/views/sessions/new.html.haml index 4b30eca6..777d3c6c 100755 --- a/app/views/sessions/new.html.haml +++ b/app/views/sessions/new.html.haml @@ -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 diff --git a/app/views/shared/_admin_nav.html.haml b/app/views/shared/_admin_nav.html.haml index 90989c15..46c0d299 100755 --- a/app/views/shared/_admin_nav.html.haml +++ b/app/views/shared/_admin_nav.html.haml @@ -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 diff --git a/config/application.yml b/config/application.yml index e5cc6a36..3fa6e046 100755 --- a/config/application.yml +++ b/config/application.yml @@ -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 diff --git a/lib/community_engine/authenticated_system.rb b/lib/community_engine/authenticated_system.rb index 21255d1e..f7dbf527 100755 --- a/lib/community_engine/authenticated_system.rb +++ b/lib/community_engine/authenticated_system.rb @@ -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 diff --git a/test/functional/base_controller_test.rb b/test/functional/base_controller_test.rb index 5c40fe53..d832177b 100755 --- a/test/functional/base_controller_test.rb +++ b/test/functional/base_controller_test.rb @@ -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 diff --git a/test/functional/sb_posts_controller_test.rb b/test/functional/sb_posts_controller_test.rb index 8e65ccbf..88ce36a9 100755 --- a/test/functional/sb_posts_controller_test.rb +++ b/test/functional/sb_posts_controller_test.rb @@ -174,7 +174,7 @@ 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 @@ -182,8 +182,9 @@ def test_disallow_new_post_to_locked_topic 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