Skip to content

Instantly share code, notes, and snippets.

@sanaumair
sanaumair / _manufacturer.erb.html
Created December 22, 2011 14:36
code logic review
<%= simple_form_for @search, :as => :search_manufacturer, :url => search_index_url(:search => @search.to_hash), :html => {:novalidate => true, :method => :get} do |search_form|%>
<% SimpleForm.wrapper_tag = nil %>
<!-- Center everything -->
<div class="center-content" itemscope itemtype ="http://schema.org/Product">
<article>
<!-- 1 column box with tabs -->
<div class="tabs">
<nav>
<%= render_filter search_form, @search.filter("boat_manufacturer") %>
</nav>
class Vanilla::ResultItem
attr_reader :fields
def initialize(result_item_hash)
@fields = result_item_hash
end
def item_type
@fields['item_type']
end
should "have translated item type in URLs for the alternate languages" do
pending do
@tags.each do |tag|
# TODO: form the URL for other languages with translated values in it #BOSOND-543
alternate_url = ''
assert_equal alternate_url, tag[:href]
unless RUBY_PLATFORM =~ /mswin|mingw/
should "have translated item type in URLs for the alternate languages" do
pending do
@tags.each do |tag|
# TODO: form the URL for other languages with translated values in it #BOSOND-543
alternate_url = ''
assert_equal alternate_url, tag[:href]
unless RUBY_PLATFORM =~ /mswin|mingw/
should "have translated item type in URLs for the alternate languages" do
pending do
@tags.each do |tag|
# TODO: form the URL for other languages with translated values in it #BOSOND-543
alternate_url = ''
assert_equal alternate_url, tag[:href]
def validate params
true
end
def validate params
temp = self.manufacturer != params[:manufacturer]||self.country_code != params[:country_code] ||self.model != params[:model]
end
EEEFEF
1) Error:
test: Make sure we have all the facet boxes needed for a certain search_type visible should item_types. (ResultItemsControllerTest):
NoMethodError: undefined method `pending' for #<ResultItemsControllerTest:0x7e23e38>
actionpack (3.1.3) lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'
actionpack (3.1.3) lib/action_dispatch/testing/integration.rb:376:in `method_missing'
test/integration/result_items_test.rb:199:in `__bind_1332339394_58788'
shoulda (2.11.3) lib/shoulda/context.rb:382:in `call'
shoulda (2.11.3) lib/shoulda/context.rb:382:in `test: Make sure we have all the facet boxes needed for a certain search_type visible should item_types. '
1) Error:
test: The page should have translated item type in URLs for the alternate languages. (AlternateLanguagesTest):
NoMethodError: undefined method `pending' for #<AlternateLanguagesTest:0x7c76118>
actionpack (3.1.3) lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'
actionpack (3.1.3) lib/action_dispatch/testing/integration.rb:376:in `method_missing'
test/integration/alternate_languages_test.rb:49:in `__bind_1332341074_297892'
shoulda (2.11.3) lib/shoulda/context.rb:382:in `call'
shoulda (2.11.3) lib/shoulda/context.rb:382:in `test: The page should have translated item type in URLs for the alternate languages. '
activesupport (3.1.3) lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
activesupport (3.1.3) lib/active_support/testing/setup_and_teardown.rb:67:in `run'
def show
def validate params
if !(self.manufacturer == params[:manufacturer] and self.country_code == params[:country_code] and self.model == params[:model])and params[search].nil?
Rails.logger.debug self.inspect
Rails.logger.debug params.inspect
raise Api::Errors::BadRequest.new 'Bad Request it should be like manufacturer-country_code-model'
end
end