diff --git a/app/controllers/producers_controller.rb b/app/controllers/producers_controller.rb new file mode 100644 index 0000000000..615f74871c --- /dev/null +++ b/app/controllers/producers_controller.rb @@ -0,0 +1,4 @@ +class ProducersController < BaseController + def index + end +end diff --git a/app/views/producers/index.haml b/app/views/producers/index.haml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/config/routes.rb b/config/routes.rb index 5f34d480b0..d514641701 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 diff --git a/spec/controllers/producers_controller_spec.rb b/spec/controllers/producers_controller_spec.rb new file mode 100644 index 0000000000..1d53bb90b9 --- /dev/null +++ b/spec/controllers/producers_controller_spec.rb @@ -0,0 +1,8 @@ +require 'spec_helper' + +describe ProducersController do + it "gets all active producers" do + Enterprise.stub_chain(:active) + get :index + end +end diff --git a/spec/features/consumer/producers_spec.rb b/spec/features/consumer/producers_spec.rb new file mode 100644 index 0000000000..b828b2abc1 --- /dev/null +++ b/spec/features/consumer/producers_spec.rb @@ -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