Commit ee9c5a8d

mo khan <mo@mokhan.ca>
2014-10-29 04:29:06
remove the old creation tags controller and views.
1 parent 7c2eb1d
app/controllers/creation_tags_controller.rb
@@ -1,15 +0,0 @@
-class CreationTagsController < ApplicationController
-  def initialize(repository = Spank::IOC.resolve(:cakes))
-    @repository = repository
-    super()
-  end
-
-  def index
-    @tags = @repository.tag_counts_on(:tags)
-  end
-
-  def show
-    @tag = params[:id].downcase.parameterize
-    @creations = @repository.tagged(@tag).page(params[:page]).per(12)
-  end
-end
app/views/creation_tags/_show.html.erb
@@ -1,25 +0,0 @@
-<div class="row-fluid">
-  <% @creations.each_slice(6).each do |batch| %>
-    <ul class='thumbnails'>
-      <% batch.each do |creation| %>
-        <% cache creation do %>
-          <li class="span2">
-            <div class="thumbnail">
-              <%= link_to cake_path(creation) do %>
-                <%= image_tag creation.primary_image.url_for(:thumb) %>
-              <% end %>
-              <div class="caption">
-                <h4><%= link_to shrink(creation.name, 12), cake_path(creation) %></h4>
-                <p><%= link_to shrink(creation.user.name, 20), profile_path(creation.user) %></p>
-                <p><small><%= time_ago_in_words(creation.created_at) %> ago.</small></p>
-              </div>
-            </div>
-          </li>
-        <% end %>
-      <% end %>
-    </ul>
-  <% end %>
-</div>
-<div id='more-button-row' class="row-fluid">
-  <%= link_to_next_page @creations, 'More...', params: { cache: false }, remote: true, class: 'more-button hidden', data: { disable_with: 'loading...' } %>
-</div>
app/views/creation_tags/index.html.erb
@@ -1,8 +0,0 @@
-<% provide(:title, "Tag, you're it".html_safe) -%>
-<div class="row-fluid">
-  <div class="span12">
-    <% tag_cloud(@tags, %w(btn-mini btn-small btn-large)) do |tag, css_class| %>
-      <%= link_to "#{tag.name} x #{tag.count}", { :action => :show, :id => tag.name }, :class => "#{css_class} btn" %>
-  <% end %>
-  </div>
-</div>
app/views/creation_tags/show.html.erb
@@ -1,7 +0,0 @@
-<% provide(:title, @tag) -%>
-<div id="bakery">
-  <%= render partial: 'show' %>
-</div>
-<div id='pagination-row' class="row-fluid">
-  <%= render "shared/paging", items: @creations %>
-</div>
app/views/creation_tags/show.js.erb
@@ -1,3 +0,0 @@
-$('#more-button-row').remove();
-$('#pagination-row').remove();
-$('#bakery').append('<%= j render partial: 'show' %>');
spec/controllers/creation_tags_controller_spec.rb
@@ -1,45 +0,0 @@
-require "rails_helper"
-
-describe CreationTagsController do
-  describe "#index" do
-    let(:cake) { create(:creation) }
-    let(:user) { create(:user) }
-
-    before :each do
-      user.tag(cake, with: "cake", on: :tags)
-      get :index
-    end
-
-    it "should load all the tags" do
-      expect(assigns(:tags).count).to eql(1)
-      expect(assigns(:tags).first.name).to eql("cake")
-    end
-  end
-
-  describe "#show" do
-    let(:user) { create(:user) }
-    let(:tag) { "cake" }
-    let(:tagged_tutorial) { create(:tutorial) }
-    let(:untagged_tutorial) { create(:tutorial) }
-    let(:tagged_cake) { create(:creation, :photos_count => 1) }
-    let(:untagged_cake) { create(:creation) }
-
-    before :each do
-      user.tag(tagged_tutorial, with: tag, on: :tags)
-      user.tag(tagged_cake, with: tag, on: :tags)
-      get :show, id: tag
-    end
-
-    it "should return each cake that is tagged" do
-      expect(assigns(:creations)).to include(tagged_cake)
-    end
-
-    it "should not return cakes that are not tagged" do
-      expect(assigns(:creations)).to_not include(untagged_cake)
-    end
-
-    it "should include the tag" do
-      expect(assigns(:tag)).to eql(tag)
-    end
-  end
-end