Permalink
Browse files

Removed backups from repository

  • Loading branch information...
Szymon Malinowski Szymon Malinowski
Szymon Malinowski authored and Szymon Malinowski committed Jan 31, 2012
1 parent 8c64040 commit ead60b63204353250ff3f4f8c260c5152c691415
View
@@ -2,4 +2,4 @@
db/*.sqlite3
log/*.log
tmp/
-*.*~
+*~
View
@@ -1,5 +0,0 @@
-.bundle
-db/*.sqlite3
-log/*.log
-tmp/
-*~
@@ -1,90 +0,0 @@
-class CartsController < ApplicationController
- # GET /carts
- # GET /carts.xml
- def index
- @carts = Cart.all
-
- respond_to do |format|
- format.html # index.html.erb
- format.xml { render :xml => @carts }
- end
- end
-
- # GET /carts/1
- # GET /carts/1.xml
- def show
- begin
- @cart = Cart.find(params[:id])
- rescue ActiveRecord::RecordNotFound
- logger.error "Attempt to access invalid cart #{params[:id]}"
- redirect_to store_url, :notice => 'Invalid cart'
- else
- respond_to do |format|
- format.html # show.html.erb
- format.xml { render :xml => @cart }
- end
- end
- end
-
- # GET /carts/new
- # GET /carts/new.xml
- def new
- @cart = Cart.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @cart }
- end
- end
-
- # GET /carts/1/edit
- def edit
- @cart = Cart.find(params[:id])
- end
-
- # POST /carts
- # POST /carts.xml
- def create
- @cart = Cart.new(params[:cart])
-
- respond_to do |format|
- if @cart.save
- format.html { redirect_to(@cart, :notice => 'Cart was successfully created.') }
- format.xml { render :xml => @cart, :status => :created, :location => @cart }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @cart.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # PUT /carts/1
- # PUT /carts/1.xml
- def update
- @cart = Cart.find(params[:id])
-
- respond_to do |format|
- if @cart.update_attributes(params[:cart])
- format.html { redirect_to(@cart, :notice => 'Cart was successfully updated.') }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @cart.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # DELETE /carts/1
- # DELETE /carts/1.xml
- def destroy
- @cart = current_cart
- @cart.destroy
- session[:cart_id] = nil
-
- respond_to do |format|
- format.html #{ redirect_to(store_url) }
- format.xml { render :xml => @cart }
- end
- end
-end
-
@@ -1,10 +0,0 @@
-page.select("#notice").each { |notice| notice.hide }
-
-page.replace_html('cart', render(@cart))
-
-page[:cart].visual_effect :blind_down if @cart.total_items == 1
-
-page[:cart].visual_effect :blind_up if @cart.total_items == 0
-
-page[:current_item].visual_effect :highlight, :startcolor => "#88ff88", :endcolor => "#114411"
-
@@ -1,18 +0,0 @@
-<% if notice %>
-<p id="notice"><%= notice %></p>
-<% end %>
-
-<h1>Your Pragmatic Catalog</h1>
-
-<% @products.each do |product| %>
- <div class="entry">
- <%= image_tag(product.image_url) %>
- <h3><%= product.title %></h3>
- <%= sanitize(product.description) %>
- <div class="price_line">
- <span class="price"><%= number_to_currency(product.price) %></span>
- <%= button_to 'Add to Cart', line_items_path(:product_id => product), :remote => true %>
- </div>
- </div>
-<% end %>
-
@@ -1,55 +0,0 @@
-require 'test_helper'
-
-class ProductsControllerTest < ActionController::TestCase
- setup do
- @product = products(:one)
- @update = {
- :title => 'Lorem Ipsum',
- :description => 'Wibbles are fun!',
- :image_url => 'lorem.jpg',
- :price => 19.95
- }
- end
-
- test "should get index" do
- get :index
- assert_response :success
- assert_not_nil assigns(:products)
- end
-
- test "should get new" do
- get :new
- assert_response :success
- end
-
- test "should create product" do
- assert_difference('Product.count') do
- post :create, :product => @update
- end
-
- assert_redirected_to product_path(assigns(:product))
- end
-
- test "should show product" do
- get :show, :id => @product.to_param
- assert_response :success
- end
-
- test "should get edit" do
- get :edit, :id => @product.to_param
- assert_response :success
- end
-
- test "should update product" do
- put :update, :id => @product.to_param, :product => @update
- assert_redirected_to product_path(assigns(:product))
- end
-
- test "should destroy product" do
- assert_difference('Product.count', -1) do
- delete :destroy, :id => @product.to_param
- end
-
- assert_redirected_to products_path
- end
-end
View
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class CartTest < ActiveSupport::TestCase
- # Replace this with your real tests.
- test "the truth" do
- assert true
- end
-end

0 comments on commit ead60b6

Please sign in to comment.