Commit 93250892 authored by deadsuperhero's avatar deadsuperhero

Merge pull request #3715 from brauliomartinezlm/3663_refactor_remove_posts_new_action

Issue #3663: [Refactor] Remove posts#new action
parents 051adfde ab3a7d99
app.Router = Backbone.Router.extend({
routes: {
//new hotness
"posts/new" : "composer",
"posts/:id": "singlePost",
"posts/:id/next": "siblingPost",
"posts/:id/previous": "siblingPost",
......@@ -25,10 +24,6 @@ app.Router = Backbone.Router.extend({
"u/:name": "stream"
},
composer : function(){
this.renderPage(function(){ return new app.pages.Composer()});
},
singlePost : function(id) {
this.renderPage(function(){ return new app.pages.PostViewer({ id: id })});
},
......
......@@ -24,10 +24,6 @@ class PostsController < ApplicationController
end
end
def new
redirect_to "/stream"
end
def show
mark_corresponding_notification_read if user_signed_in?
......
-# Copyright (c) 2010-2012, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%iframe{:src =>"/posts/new", :height => 500, :width => 980, :style => "border:none;"}
\ No newline at end of file
......@@ -28,8 +28,6 @@ Diaspora::Application.routes.draw do
resources :comments, :only => [:new, :create, :destroy, :index]
end
match "/framer" => redirect("/posts/new")
get 'p/:id' => 'posts#show', :as => 'short_post'
get 'posts/:id/iframe' => 'posts#iframe', :as => 'iframe'
......
......@@ -34,7 +34,7 @@ describe StatusMessagesController do
doc.xpath('//head').count.should equal 1
doc.xpath('//body').count.should equal 1
save_fixture(html_for('body'), 'empty_bookmarklet')
save_fixture(html_for('body'), 'empty_bookmarklet')
end
it 'accepts get params' do
......@@ -53,13 +53,6 @@ describe StatusMessagesController do
end
end
describe '#new_bookmarklet' do
it 'works' do
get :new_bookmarklet
response.should be_success
end
end
describe '#new' do
it 'succeeds' do
get :new,
......@@ -91,35 +84,35 @@ describe StatusMessagesController do
response.status.should == 302
response.should be_redirect
end
it 'creates with invalid html' do
post :create, status_message_hash.merge(:status_message => { :text => "0123456789" * 7000 })
response.status.should == 302
response.should be_redirect
end
it 'creates with valid json' do
post :create, status_message_hash.merge(:format => 'json')
response.status.should == 201
end
it 'creates with invalid json' do
post :create, status_message_hash.merge(:status_message => { :text => "0123456789" * 7000 }, :format => 'json')
response.status.should == 403
end
it 'creates with valid mobile' do
post :create, status_message_hash.merge(:format => 'mobile')
response.status.should == 302
response.should be_redirect
end
it 'creates with invalid mobile' do
post :create, status_message_hash.merge(:status_message => { :text => "0123456789" * 7000 }, :format => 'mobile')
response.status.should == 302
response.should be_redirect
end
it 'removes getting started from new users' do
@controller.should_receive(:remove_getting_started)
post :create, status_message_hash
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment