Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen van Bergerem committed Feb 14, 2016
1 parent 2a47b88 commit 89f21e8
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 213 deletions.
10 changes: 0 additions & 10 deletions app/assets/javascripts/app/views/photo_viewer.js

This file was deleted.

3 changes: 0 additions & 3 deletions app/assets/templates/activity-streams-photo_tpl.jst.hbs

This file was deleted.

7 changes: 0 additions & 7 deletions app/assets/templates/photo-viewer_tpl.jst.hbs

This file was deleted.

5 changes: 0 additions & 5 deletions app/assets/templates/stream-faces_tpl.jst.hbs

This file was deleted.

10 changes: 1 addition & 9 deletions app/controllers/people_controller.rb
Expand Up @@ -6,9 +6,8 @@ class PeopleController < ApplicationController
before_action :authenticate_user!, except: %i(show stream hovercard)
before_action :find_person, only: %i(show stream hovercard)

respond_to :html, :except => [:tag_index]
respond_to :html
respond_to :json, :only => [:index, :show]
respond_to :js, :only => [:tag_index]

rescue_from ActiveRecord::RecordNotFound do
render :file => Rails.root.join('public', '404').to_s,
Expand Down Expand Up @@ -64,13 +63,6 @@ def refresh_search
render :json => { :search_count => @people.count, :search_html => @answer_html }.to_json
end


def tag_index
profiles = Profile.tagged_with(params[:name]).where(:searchable => true).select('profiles.id, profiles.person_id')
@people = Person.where(:id => profiles.map{|p| p.person_id}).paginate(:page => params[:page], :per_page => 15)
respond_with @people
end

# renders the persons user profile page
def show
mark_corresponding_notifications_read if user_signed_in?
Expand Down
28 changes: 0 additions & 28 deletions app/controllers/photos_controller.rb
Expand Up @@ -109,34 +109,6 @@ def destroy
end
end

def edit
if @photo = current_user.photos.where(:id => params[:id]).first
respond_with @photo
else
redirect_to person_photos_path(current_user.person)
end
end

def update
photo = current_user.photos.where(:id => params[:id]).first
if photo
if current_user.update_post( photo, photo_params )
flash.now[:notice] = I18n.t 'photos.update.notice'
respond_to do |format|
format.js{ render :json => photo, :status => 200 }
end
else
flash.now[:error] = I18n.t 'photos.update.error'
respond_to do |format|
format.html{ redirect_to [:edit, photo] }
format.js{ render :status => 403 }
end
end
else
redirect_to person_photos_path(current_user.person)
end
end

private

def photo_params
Expand Down
1 change: 0 additions & 1 deletion app/views/aspects/_aspect_stream.haml
Expand Up @@ -7,7 +7,6 @@
= stream.title

= render 'publisher/publisher', publisher_aspects_for(stream)
= render 'aspects/no_posts_message'

#gs-shim{:title => popover_with_close_html("3. #{t('.stay_updated')}"), 'data-content' => t('.stay_updated_explanation')}

Expand Down
6 changes: 0 additions & 6 deletions app/views/aspects/_no_posts_message.haml

This file was deleted.

1 change: 0 additions & 1 deletion app/views/people/tag_index.js.erb

This file was deleted.

15 changes: 0 additions & 15 deletions app/views/photos/edit.html.haml

This file was deleted.

3 changes: 0 additions & 3 deletions app/views/tags/update.js.erb

This file was deleted.

52 changes: 0 additions & 52 deletions public/javascripts/custom-mobile-scripting.js

This file was deleted.

15 changes: 0 additions & 15 deletions spec/controllers/people_controller_spec.rb
Expand Up @@ -116,21 +116,6 @@
end
end

describe '#tag_index' do
it 'works for js' do
xhr :get, :tag_index, :name => 'jellybeans', :format => :js
expect(response).to be_success
end

it 'returns awesome people who have that tag' do
f = FactoryGirl.create(:person)
f.profile.tag_string = "#seeded"
f.profile.save
xhr :get, :tag_index, :name => 'seeded', :format => :js
expect(assigns[:people].count).to eq(1)
end
end

describe "#show performance", :performance => true do
before do
require 'benchmark'
Expand Down
39 changes: 0 additions & 39 deletions spec/controllers/photos_controller_spec.rb
Expand Up @@ -175,18 +175,6 @@
end
end

describe '#edit' do
it "succeeds when user owns the photo" do
get :edit, :id => @alices_photo.id
expect(response).to be_success
end

it "redirects when the user does not own the photo" do
get :edit, :id => @bobs_photo.id
expect(response).to redirect_to(:action => :index, :person_id => alice.person.guid.to_s)
end
end

describe '#destroy' do
it 'let a user delete his message' do
delete :destroy, :id => @alices_photo.id
Expand Down Expand Up @@ -217,33 +205,6 @@
end
end

describe "#update" do
it "updates the caption of a photo" do
put :update, :id => @alices_photo.id, :photo => { :text => "now with lasers!" }, :format => :js
expect(@alices_photo.reload.text).to eq("now with lasers!")
end

it "doesn't allow mass assignment of person" do
new_user = FactoryGirl.create(:user)
params = { :text => "now with lasers!", :author => new_user }
put :update, :id => @alices_photo.id, :photo => params, :format => :js
expect(@alices_photo.reload.author).to eq(alice.person)
end

it "doesn't allow mass assignment of person_id" do
new_user = FactoryGirl.create(:user)
params = { :text => "now with lasers!", :author_id => new_user.id }
put :update, :id => @alices_photo.id, :photo => params, :format => :js
expect(@alices_photo.reload.author_id).to eq(alice.person.id)
end

it 'redirects if you do not have access to the post' do
params = { :text => "now with lasers!" }
put :update, :id => @bobs_photo.id, :photo => params
expect(response).to redirect_to(:action => :index, :person_id => alice.person.guid.to_s)
end
end

describe "#make_profile_photo" do
it 'should return a 201 on a js success' do
xhr :get, :make_profile_photo, :photo_id => @alices_photo.id, :format => 'js'
Expand Down
19 changes: 0 additions & 19 deletions spec/javascripts/app/views/photo_viewer_spec.js

This file was deleted.

0 comments on commit 89f21e8

Please sign in to comment.