Starting on the producers controller

This commit is contained in:
Will Marshall
2014-04-30 12:05:53 +10:00
parent 563976c084
commit 4ca148ee93
5 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
class ProducersController < BaseController
def index
end
end

View File

View File

@@ -7,6 +7,8 @@ Openfoodnetwork::Application.routes.draw do
get :order_cycle
end
resources :producers, only: :index
namespace :shop do
get '/checkout', :to => 'checkout#edit' , :as => :checkout
put '/checkout', :to => 'checkout#update' , :as => :update_checkout

View File

@@ -0,0 +1,8 @@
require 'spec_helper'
describe ProducersController do
it "gets all active producers" do
Enterprise.stub_chain(:active)
get :index
end
end

View File

@@ -0,0 +1,15 @@
require 'spec_helper'
feature %q{
As a consumer
I want to see a list of producers
So that I can shop at hubs distributing their products
} do
include UIComponentHelper
let!(:producer) { create(:supplier_enterprise) }
it "shows all producers" do
visit producers_path
page.should have_content producer.name
end
end