mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Display supplier details on supplier page
This commit is contained in:
@@ -6,9 +6,10 @@ module Spree
|
||||
options = {:supplier_id => params[:id]}
|
||||
options.merge(params.reject { |k,v| k == :id })
|
||||
|
||||
@supplier = Supplier.find params[:id]
|
||||
|
||||
@searcher = Config.searcher_class.new(options)
|
||||
@products = @searcher.retrieve_products
|
||||
render :template => 'spree/products/index'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
7
app/views/spree/suppliers/show.html.erb
Normal file
7
app/views/spree/suppliers/show.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<h2><%= @supplier.name %></h2>
|
||||
|
||||
<div class="supplier-description"><%= @supplier.long_description %></div>
|
||||
|
||||
<h3>Available Now</h3>
|
||||
|
||||
<%= render :template => 'spree/products/index' %>
|
||||
@@ -30,7 +30,11 @@ feature %q{
|
||||
visit spree.root_path
|
||||
click_link s.name
|
||||
|
||||
# Then I should see the product
|
||||
# Then I should see the supplier details
|
||||
page.should have_selector 'h2', :text => s.name
|
||||
page.should have_selector 'div.supplier-description', :text => s.long_description
|
||||
|
||||
# And I should see the product
|
||||
page.should have_content p.name
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user