mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
Starting on the producers controller
This commit is contained in:
4
app/controllers/producers_controller.rb
Normal file
4
app/controllers/producers_controller.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class ProducersController < BaseController
|
||||
def index
|
||||
end
|
||||
end
|
||||
0
app/views/producers/index.haml
Normal file
0
app/views/producers/index.haml
Normal 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
|
||||
|
||||
8
spec/controllers/producers_controller_spec.rb
Normal file
8
spec/controllers/producers_controller_spec.rb
Normal 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
|
||||
15
spec/features/consumer/producers_spec.rb
Normal file
15
spec/features/consumer/producers_spec.rb
Normal 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
|
||||
Reference in New Issue
Block a user