Display supplier details on supplier page

This commit is contained in:
Rohan Mitchell
2012-10-10 12:08:35 +11:00
parent c07a33d88c
commit 58e5724f81
3 changed files with 14 additions and 2 deletions

View File

@@ -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

View 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' %>

View File

@@ -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