Renaming everything to Shop

This commit is contained in:
Will Marshall
2013-12-05 13:40:05 +11:00
parent f525b7aea1
commit 4543e08872
13 changed files with 91 additions and 12 deletions

View File

@@ -2,8 +2,8 @@
# More info at https://github.com/guard/guard#readme
guard 'livereload' do
#watch(%r{app/views/.+\.(erb|haml|slim)$})
#watch(%r{app/helpers/.+\.rb})
watch(%r{app/views/.+\.(erb|haml|slim)$})
watch(%r{app/helpers/.+\.rb})
watch(%r{public/.+\.(css|js|html)})
#watch(%r{config/locales/.+\.yml})
# Rails Assets Pipeline

View File

@@ -1,3 +0,0 @@
class DistributorsController < ApplicationController
layout "darkswarm"
end

View File

@@ -0,0 +1,9 @@
class ShopController < BaseController
layout "darkswarm"
def index
@distributor = current_distributor
end
end

View File

@@ -1,2 +0,0 @@
module DistributorsHelper
end

View File

@@ -0,0 +1,3 @@
module ShopHelper
end

View File

@@ -0,0 +1 @@
About Us

View File

@@ -0,0 +1 @@
Contact Us

View File

@@ -0,0 +1,13 @@
%table#product-list
%thead
%th Item
%th Description
%th Variant
%th Quantity
%th Available?
%th Price
- list.each do |product|
%tr
%td= product.name
%td= product.description

View File

@@ -0,0 +1,10 @@
= @distributor.name
%description
= @distributor.long_description.andand.html_safe
= render partial: "enterprises/contact_us"
= render partial: "enterprises/about_us"

View File

@@ -2,6 +2,8 @@ Openfoodnetwork::Application.routes.draw do
root :to => 'home#temp_landing_page'
resources :shop
resources :enterprises do
collection do
get :suppliers

View File

@@ -1,5 +0,0 @@
require 'spec_helper'
describe DistributorsController do
end

View File

@@ -0,0 +1,7 @@
require 'spec_helper'
describe DistributorsController do
it "should set the distributor when loading show"
it "should create/load an order when loading show"
end

View File

@@ -0,0 +1,43 @@
require 'spec_helper'
feature "As a consumer I want to shop with a distributor" do
include AuthenticationWorkflow
include WebHelper
describe "Viewing a distributor" do
let(:distributor) { create(:distributor_enterprise) }
before do #temporarily using the old way to select distributor
create_enterprise_group_for distributor
visit "/"
click_link distributor.name
end
it "shows a distributor" do
visit shop_index_path
page.should have_text distributor.name
end
describe "selecting an order cycle" do
it "selects an order cycle if only one is open" do
# create order cycle
oc1 = create(:simple_order_cycle, name: 'oc 1', distributors: [distributor])
exchange = Exchange.find(oc1.exchanges.to_enterprises(d).outgoing.first.id)
exchange.update_attribute :pickup_time, "turtles"
visit shop_index_path
page.should have_selector "option[selected]", text: 'Packing'
# Should see order cycle selected in dropdown
# (Should also render products)
end
context "when no order cycles are available" do
it "shows the last order cycle, if any"
it "shows the next order cycle, if any"
end
it "renders the order cycle selector when multiple order cycles are available"
it "allows the user to select an order cycle"
end
end
end