office_clerk 0.5 → 0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog.md +15 -0
- data/Gemfile +0 -13
- data/Gemfile.lock +50 -83
- data/Guardfile +28 -0
- data/app/controllers/admin_controller.rb +6 -2
- data/app/controllers/baskets_controller.rb +2 -1
- data/app/controllers/categories_controller.rb +2 -1
- data/app/controllers/office_controller.rb +5 -0
- data/app/controllers/products_controller.rb +1 -1
- data/app/controllers/sessions_controller.rb +5 -0
- data/app/helpers/shop_helper.rb +0 -11
- data/app/models/basket.rb +2 -2
- data/app/models/clerk.rb +1 -3
- data/app/models/order.rb +3 -3
- data/app/views/baskets/_small.html.haml +1 -0
- data/app/views/baskets/index.html.haml +3 -3
- data/app/views/baskets/show.html.haml +1 -2
- data/app/views/categories/edit.html.haml +2 -1
- data/app/views/categories/index.html.haml +19 -8
- data/app/views/categories/show.html.haml +31 -26
- data/app/views/clerks/index.html.haml +4 -4
- data/app/views/layouts/_header_extra.haml +1 -2
- data/app/views/layouts/office_clerk.csv.erb +1 -0
- data/app/views/order_mailer/cancel.text.erb +24 -0
- data/app/views/order_mailer/confirm.text.erb +36 -0
- data/app/views/order_mailer/paid.text.erb +28 -0
- data/app/views/order_mailer/shipped.text.erb +24 -0
- data/app/views/orders/index.csv.erb +5 -0
- data/app/views/orders/index.html.haml +39 -45
- data/app/views/orders/show.html.haml +23 -11
- data/app/views/products/_triple.html.haml +2 -2
- data/app/views/products/index.html.haml +37 -19
- data/app/views/purchases/index.html.haml +4 -3
- data/app/views/shop/_product_box.haml +12 -12
- data/app/views/suppliers/index.html.haml +5 -5
- data/bin/rake +0 -4
- data/bin/rspec +0 -4
- data/config/locales/en.yml +5 -0
- data/config/locales/fi.yml +5 -0
- data/config/spring.rb +1 -0
- data/lib/office_clerk.rb +3 -1
- data/lib/office_clerk/engine.rb +5 -1
- data/lib/office_clerk/shipping_method.rb +1 -1
- data/lib/office_clerk/version.rb +1 -1
- data/office_clerk.gemspec +3 -1
- data/spec/features/categories_search_spec.rb +47 -0
- data/spec/features/products/index_spec.rb +58 -9
- data/spec/models/clerk/email_spec.rb +4 -4
- data/spec/spec_helper.rb +6 -47
- data/spec/support/basket_helper.rb +9 -0
- data/spec/support/product_helper.rb +25 -0
- data/spec/support/request_helper.rb +4 -4
- data/spec/support/setup/admin.rb +4 -0
- data/spec/support/setup/capybara.rb +14 -0
- data/spec/support/setup/cleaner.rb +22 -0
- data/spec/support/setup/email.rb +6 -0
- data/spec/support/setup/factory_girl.rb +3 -0
- metadata +95 -51
- data/app/views/order_mailer/cancel.html.haml +0 -6
- data/app/views/order_mailer/confirm.html.haml +0 -7
- data/app/views/order_mailer/paid.html.haml +0 -6
- data/app/views/order_mailer/shipped.html.haml +0 -6
- data/config/i18n-tasks.yml +0 -11
- data/spec/support/factory_girl.rb +0 -6
- data/test_app/spec/rails_helper.rb +0 -50
- data/test_app/spec/spec_helper.rb +0 -85
@@ -8,16 +8,10 @@
|
|
8
8
|
= t(:ordered_on) + " : " + date(@order.ordered_on)
|
9
9
|
%p
|
10
10
|
%b
|
11
|
-
= t(:
|
12
|
-
%p
|
13
|
-
%b
|
14
|
-
= t(:total_tax) + " : " + euros(@order.basket.total_tax)
|
15
|
-
%p
|
16
|
-
%b
|
17
|
-
= t(:shipment_price) + " : " + euros(@order.shipment_price)
|
11
|
+
= t(:email) + " : " + @order.email.to_s
|
18
12
|
%p
|
19
13
|
%b
|
20
|
-
= t(:
|
14
|
+
= t(:shipment_type) + " : " + @order.shipment_type.to_s
|
21
15
|
.col-md-4
|
22
16
|
%p
|
23
17
|
%b
|
@@ -35,12 +29,30 @@
|
|
35
29
|
%p
|
36
30
|
%b
|
37
31
|
= t(:canceled_on) + " : " + date(@order.canceled_on)
|
38
|
-
|
39
|
-
|
40
|
-
|
32
|
+
-content_for :basket do
|
33
|
+
%tr
|
34
|
+
%td{:colspan => 2}
|
35
|
+
%td
|
36
|
+
%b= t(:total_tax) + " : "
|
37
|
+
%td
|
38
|
+
%b= euros(@order.total_tax)
|
39
|
+
%tr
|
40
|
+
%td{:colspan => 2}
|
41
|
+
%td
|
42
|
+
%b= t(:shipment_price) + " : "
|
43
|
+
%td
|
44
|
+
%b= euros(@order.shipment_price)
|
45
|
+
%tr
|
46
|
+
%td{:colspan => 2}
|
47
|
+
%td
|
48
|
+
%b= t(:total_price) + " : "
|
49
|
+
%td
|
50
|
+
%b= euros(@order.total_price)
|
51
|
+
|
41
52
|
.row
|
42
53
|
= render "baskets/small" , :basket => @order.basket
|
43
54
|
.row
|
55
|
+
%br
|
44
56
|
.col-md-2
|
45
57
|
= link_to t(:back), orders_path, :class => "btn btn-warning"
|
46
58
|
.col-md-10
|
@@ -1,5 +1,5 @@
|
|
1
|
-
%h3= products.length.to_s + " " + t(:products)
|
2
1
|
.row
|
2
|
+
%h3= products.length.to_s + " " + t(:products)
|
3
3
|
%table.table.table-striped.table-bordered.table-condensed
|
4
4
|
%tbody
|
5
5
|
- products.in_groups_of(3).each do |array|
|
@@ -8,5 +8,5 @@
|
|
8
8
|
-next unless product
|
9
9
|
%td= image_tag product.main_picture.url(:thumb)
|
10
10
|
%td
|
11
|
-
= link_to product_path(product), :title => t(:show) do
|
11
|
+
= link_to product_path(product), :title => t(:show) , :class => product.online && "online" do
|
12
12
|
= product.full_name
|
@@ -38,7 +38,7 @@
|
|
38
38
|
%td.image= image_tag product.main_picture.url(:thumb)
|
39
39
|
%td.ean= product.line? ? "#{product.products.length} #{t(:items)}" : product.ean
|
40
40
|
%td.name
|
41
|
-
= link_to product_path(product), :title => t(:show) do
|
41
|
+
= link_to product_path(product), :title => t(:show) , :class => product.online && "online" do
|
42
42
|
=product.full_name
|
43
43
|
%td.price=euros(product.price)
|
44
44
|
%td.supplier
|
@@ -52,38 +52,56 @@
|
|
52
52
|
%td= link_to t(:edit) ,edit_product_path(product), :title => t(:edit)
|
53
53
|
= paginate @products
|
54
54
|
.col-md-3
|
55
|
-
= search_form_for @q, :url => search_products_path, :html => { :class => "
|
55
|
+
= search_form_for @q, :url => search_products_path, :html => { :class => "form-horizontal" }, :method => :get do |f|
|
56
56
|
.form-group
|
57
|
-
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
.input-group
|
58
|
+
- if params[:basket]
|
59
|
+
= hidden_field_tag :basket , params[:basket]
|
60
|
+
= f.text_field :name_or_product_name_cont, :class => "form-control" , :placeholder => t(:name)
|
61
|
+
-else
|
62
|
+
= f.text_field :name_cont, :class => "form-control" , :placeholder => t(:name)
|
63
|
+
%span.input-group-addon
|
64
|
+
=t(:online)
|
65
|
+
= f.radio_button :online_eq , true
|
62
66
|
.form-group
|
63
|
-
|
67
|
+
.input-group
|
68
|
+
= f.text_field :summary_cont , :class => "form-control" , :placeholder => t(:summary)
|
69
|
+
%span.input-group-addon
|
70
|
+
=t(:blanks)
|
71
|
+
= f.radio_button :summary_blank , true
|
64
72
|
.form-group
|
65
|
-
|
73
|
+
.input-group
|
74
|
+
= f.text_field :description_cont , :class => "form-control" , :placeholder => t(:description)
|
75
|
+
%span.input-group-addon
|
76
|
+
=t(:blanks)
|
77
|
+
= f.radio_button :description_blank , true
|
66
78
|
.form-group
|
67
|
-
|
68
|
-
|
69
|
-
.col-md-
|
79
|
+
.col-md-6
|
80
|
+
= f.text_field :ean_cont , :class => "form-control" , :placeholder => t(:ean)
|
81
|
+
.col-md-6
|
82
|
+
= f.text_field :scode_cont , :class => "form-control" , :placeholder => t(:scode)
|
83
|
+
.form-group
|
84
|
+
.col-md-4
|
70
85
|
= f.label(:price)
|
71
86
|
.col-md-4
|
72
87
|
= f.text_field :price_gteq , :class => "form-control"
|
73
88
|
.col-md-4
|
74
89
|
= f.text_field :price_lteq , :class => "form-control"
|
75
|
-
|
76
|
-
.col-md-3
|
90
|
+
.col-md-4
|
77
91
|
= f.label(:inventory)
|
78
92
|
.col-md-4
|
79
93
|
= f.text_field :inventory_gteq , :class => "form-control"
|
80
94
|
.col-md-4
|
81
95
|
= f.text_field :inventory_lteq , :class => "form-control"
|
82
96
|
.form-group
|
83
|
-
|
84
|
-
|
97
|
+
.col-md-4
|
98
|
+
= f.label t(:supplier)
|
99
|
+
.col-md-8
|
100
|
+
= f.collection_select :supplier_id_eq, Supplier.all, :id, :supplier_name, {:include_blank => true}, :class=>"form-control"
|
85
101
|
.form-group
|
86
|
-
|
87
|
-
|
88
|
-
|
102
|
+
.col-md-4
|
103
|
+
= f.label t(:category)
|
104
|
+
.col-md-8
|
105
|
+
= f.collection_select :category_id_eq, Category.all, :id, :name, {:include_blank => true}, :class=>"form-control"
|
106
|
+
= f.submit t(:filter), :class => "btn btn-success" , :id => :filter
|
89
107
|
= link_to t(:cancel), products_path, :class => "btn btn-warning"
|
@@ -29,9 +29,9 @@
|
|
29
29
|
.btn-group
|
30
30
|
= paginate @purchases
|
31
31
|
.col-md-3
|
32
|
-
= search_form_for @q, :url => search_purchases_path, :html => { :class => "
|
32
|
+
= search_form_for @q, :url => search_purchases_path, :html => { :class => "form-horizontal" }, :method => :post do |f|
|
33
33
|
.form-group
|
34
|
-
= f.text_field :name_cont , :placeholder => t(:name)
|
34
|
+
= f.text_field :name_cont , :class => "form-control" , :placeholder => t(:name)
|
35
35
|
.row
|
36
36
|
.col-md-10
|
37
37
|
= f.label(:ordered_on)
|
@@ -48,5 +48,6 @@
|
|
48
48
|
= f.text_field :received_on_gt , :class => "form-control datepicker"
|
49
49
|
.col-md-5
|
50
50
|
= f.text_field :received_on_lt , :class => "form-control datepicker"
|
51
|
-
|
51
|
+
%br
|
52
|
+
= f.submit t(:filter), :id => :filter , :class => "btn btn-success"
|
52
53
|
= link_to t(:cancel), purchases_path, :class => "btn btn-warning"
|
@@ -1,13 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
%h4.product-name
|
2
|
+
=link_to shop_product_path(:link => product.link ) do
|
3
3
|
= product.name
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
.row
|
5
|
+
.col-md-4
|
6
|
+
.square-image
|
7
|
+
=image_tag product.main_picture.url
|
8
|
+
.col-md-8.bottom
|
9
|
+
.product-fact
|
10
|
+
%p= markdown product.summary
|
11
|
+
= link_to shop_product_path( :link => product.link ) , :class => :info do
|
12
|
+
.price.selling
|
13
|
+
= euros product.price
|
@@ -23,18 +23,18 @@
|
|
23
23
|
%tbody
|
24
24
|
- @suppliers.each do |supplier|
|
25
25
|
%tr{:class => "line-#{cycle("1","2")}"}
|
26
|
-
%td=supplier.supplier_name
|
26
|
+
%td.name=supplier.supplier_name
|
27
27
|
%td=supplier.products.count
|
28
28
|
%td=supplier.whole_address
|
29
29
|
%td= link_to t(:show) , supplier_path(supplier), :title => t(:show)
|
30
30
|
%td= link_to t(:edit) , edit_supplier_path(supplier), :title => t(:edit)
|
31
31
|
= paginate @suppliers
|
32
32
|
.col-md-3
|
33
|
-
= search_form_for @q, :url => search_suppliers_path, :html => { :class => "
|
33
|
+
= search_form_for @q, :url => search_suppliers_path, :html => { :class => "form-horizontal" }, :method => :post do |f|
|
34
34
|
.form-group
|
35
|
-
= f.text_field :supplier_name_cont , :placeholder => t(:name)
|
35
|
+
= f.text_field :supplier_name_cont , :class => "form-control", :placeholder => t(:name)
|
36
36
|
.form-group
|
37
|
-
= f.text_field :address_cont , :placeholder => t(:address)
|
38
|
-
= f.submit t(:filter), :class => "btn btn-success"
|
37
|
+
= f.text_field :address_cont , :class => "form-control", :placeholder => t(:address)
|
38
|
+
= f.submit t(:filter), :id => :filter , :class => "btn btn-success"
|
39
39
|
= link_to t(:cancel), suppliers_path, :class => "btn btn-warning"
|
40
40
|
|
data/bin/rake
CHANGED
data/bin/rspec
CHANGED
data/config/locales/en.yml
CHANGED
@@ -17,6 +17,7 @@ en:
|
|
17
17
|
basket_locked: Basket is locked, unlock to change
|
18
18
|
baskets: Baskets
|
19
19
|
between: ' between'
|
20
|
+
blanks: Blanks
|
20
21
|
cancel: Cancel
|
21
22
|
canceled_on: Canceled on
|
22
23
|
cancel_order_button: Cancel email
|
@@ -48,6 +49,7 @@ en:
|
|
48
49
|
extra_picture: Extra picture
|
49
50
|
filter: Filter
|
50
51
|
first_name: First Name
|
52
|
+
fix_errors: There are errors below
|
51
53
|
history: Order history
|
52
54
|
home: Home
|
53
55
|
info: Info
|
@@ -121,6 +123,7 @@ en:
|
|
121
123
|
shipped_on: Shipped on
|
122
124
|
shipped_order_button: Ship Order Email
|
123
125
|
shop: Shop
|
126
|
+
shop_link: In Shop
|
124
127
|
show: Show
|
125
128
|
sign_in: Log in
|
126
129
|
sign_in_invalid: Invalid email or password
|
@@ -175,6 +178,7 @@ en:
|
|
175
178
|
link: Link
|
176
179
|
position: Position
|
177
180
|
description: Description
|
181
|
+
summary: Summary
|
178
182
|
order:
|
179
183
|
email: Email
|
180
184
|
ordered_on: Ordered on
|
@@ -184,6 +188,7 @@ en:
|
|
184
188
|
received_on: Received on
|
185
189
|
product:
|
186
190
|
description: Description
|
191
|
+
summary: Summary
|
187
192
|
ean: Ean
|
188
193
|
inventory: Inventory
|
189
194
|
name: Name
|
data/config/locales/fi.yml
CHANGED
@@ -15,6 +15,7 @@ fi:
|
|
15
15
|
basket_locked: Ostoskoria ei voi muuttaa
|
16
16
|
baskets: Ostoskorit
|
17
17
|
between: haarukka
|
18
|
+
blanks: Tyhjät
|
18
19
|
cancel: Peruuta
|
19
20
|
cancel_order_button: Peruta s-post
|
20
21
|
canceled_on: Peruutettu
|
@@ -47,6 +48,7 @@ fi:
|
|
47
48
|
extra_picture: Toinen kuva
|
48
49
|
filter: Hae
|
49
50
|
first_name: Etunimi
|
51
|
+
fix_errors: Yhteystiedoistasi puuttuu tietoja
|
50
52
|
history: Tilaushistoria
|
51
53
|
home: Kotiin
|
52
54
|
info: Info
|
@@ -121,6 +123,7 @@ fi:
|
|
121
123
|
shipped_on: Lähetetty
|
122
124
|
shipped_order_button: Lähetetty S-Posti
|
123
125
|
shop: Kauppa
|
126
|
+
shop_link: Kauppassa
|
124
127
|
show: Näytä
|
125
128
|
sign_in: Kirjaudu sisään
|
126
129
|
sign_in_invalid: Sposti tai salasana virheellinen
|
@@ -170,6 +173,7 @@ fi:
|
|
170
173
|
street: Osoite
|
171
174
|
category:
|
172
175
|
name: Nimi
|
176
|
+
summary: Yhteenveto
|
173
177
|
online: Netissä
|
174
178
|
category: Pääryhmä
|
175
179
|
link: Linkki
|
@@ -180,6 +184,7 @@ fi:
|
|
180
184
|
ordered_on: Tilattu
|
181
185
|
product:
|
182
186
|
description: Kuvaus
|
187
|
+
summary: Yhteenveto
|
183
188
|
ean: Ean
|
184
189
|
inventory: Inventaario
|
185
190
|
name: Nimi
|
data/config/spring.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Spring.application_root = "./test_app"
|
data/lib/office_clerk.rb
CHANGED
@@ -4,7 +4,7 @@ require "haml"
|
|
4
4
|
require "jquery-ui-rails"
|
5
5
|
require "kramdown"
|
6
6
|
require "will_paginate"
|
7
|
-
|
7
|
+
require 'coffee_script'
|
8
8
|
require 'will_paginate-bootstrap'
|
9
9
|
require 'bootstrap-sass'
|
10
10
|
require 'bootstrap_form'
|
@@ -13,6 +13,8 @@ require 'rails-i18n'
|
|
13
13
|
require "jquery-rails"
|
14
14
|
require "gon"
|
15
15
|
require "bcrypt"
|
16
|
+
require "valid_email"
|
17
|
+
require "ransack"
|
16
18
|
|
17
19
|
require "office_clerk/shipping_method"
|
18
20
|
|
data/lib/office_clerk/engine.rb
CHANGED
@@ -13,7 +13,11 @@ module OfficeClerk
|
|
13
13
|
I18n.default_locale = :fi
|
14
14
|
config.after_initialize do
|
15
15
|
end
|
16
|
-
|
16
|
+
# for testing this makes engine factories available
|
17
|
+
initializer "model_core.factories", :after => "factory_girl.set_factory_paths" do
|
18
|
+
FactoryGirl.definition_file_paths << File.expand_path('../../../spec/factories', __FILE__) if defined?(FactoryGirl)
|
19
|
+
end
|
20
|
+
|
17
21
|
config.paperclip_defaults = { :styles => {:thumb => '48x48>', :list => '150x150>', :product => '600x600>' },
|
18
22
|
:default_style => :list,
|
19
23
|
:url => "/images/:id/:style/:basename.:extension",
|
data/lib/office_clerk/version.rb
CHANGED
data/office_clerk.gemspec
CHANGED
@@ -23,7 +23,9 @@ Gem::Specification.new do |s|
|
|
23
23
|
|
24
24
|
s.has_rdoc = false
|
25
25
|
|
26
|
-
s.add_runtime_dependency 'rails', '~> 4.
|
26
|
+
s.add_runtime_dependency 'rails', '~> 4.1', '<= 4.2'
|
27
|
+
s.add_runtime_dependency "ransack" , '>= 1.5.1'
|
28
|
+
s.add_runtime_dependency "valid_email"
|
27
29
|
s.add_runtime_dependency 'sass-rails' , '~> 4.0'
|
28
30
|
s.add_runtime_dependency "haml" , '~> 4.0'
|
29
31
|
s.add_runtime_dependency "jquery-rails" , '~> 3.1'
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#this file is included by category_spec, so the guard matchers work
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe "Category search" do
|
6
|
+
before :each do
|
7
|
+
sign_in
|
8
|
+
end
|
9
|
+
it "lists no categories" do
|
10
|
+
visit_path categories_path
|
11
|
+
expect(category_count).to be 0
|
12
|
+
end
|
13
|
+
it "lists correct number of unfiltered categories" do
|
14
|
+
category_ab :name => ["one","two", "more"]
|
15
|
+
expect(category_count).to be 3
|
16
|
+
end
|
17
|
+
it "filters by online" do
|
18
|
+
category_ab :online => [true, false]
|
19
|
+
choose("q[online_eq]")
|
20
|
+
expect(category_count).to be 1
|
21
|
+
end
|
22
|
+
it "filters by name" do
|
23
|
+
category_ab :name =>[ "i have a name", "nono"]
|
24
|
+
fill_in("q[name_cont]" , :with => "name")
|
25
|
+
expect(category_count).to be 1
|
26
|
+
end
|
27
|
+
it "filters by empty summary" do
|
28
|
+
category_ab :summary =>[ "i have a summary", ""]
|
29
|
+
choose("q[summary_blank]")
|
30
|
+
expect(category_count).to be 1
|
31
|
+
end
|
32
|
+
it "filters by summary" do
|
33
|
+
category_ab :summary =>[ "i have a summary", ""]
|
34
|
+
fill_in("q[summary_cont]" , :with => "have")
|
35
|
+
expect(category_count).to be 1
|
36
|
+
end
|
37
|
+
it "filters by description" do
|
38
|
+
category_ab :description =>[ "i have a name", "nono"]
|
39
|
+
fill_in("q[description_cont]" , :with => "name")
|
40
|
+
expect(category_count).to be 1
|
41
|
+
end
|
42
|
+
it "filters by empty description" do
|
43
|
+
category_ab :description =>[ "i have a description", ""]
|
44
|
+
choose("q[description_blank]")
|
45
|
+
expect(category_count).to be 1
|
46
|
+
end
|
47
|
+
end
|
@@ -4,13 +4,62 @@ describe "GET /products" do
|
|
4
4
|
before :each do
|
5
5
|
sign_in
|
6
6
|
end
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
it "lists no products" do
|
8
|
+
visit_path products_path
|
9
|
+
expect(product_count).to be 0
|
10
|
+
end
|
11
|
+
it "lists correct number of unfiltered products" do
|
12
|
+
product_ab :price => [8 ,12,14,16]
|
13
|
+
expect(product_count).to be 4
|
14
|
+
end
|
15
|
+
it "filters by name" do
|
16
|
+
product_ab :name =>[ "i have a name", "nono"]
|
17
|
+
fill_in("q[name_cont]" , :with => "name")
|
18
|
+
expect(product_count).to be 1
|
19
|
+
end
|
20
|
+
it "filters by online" do
|
21
|
+
product_ab :online => [true, false]
|
22
|
+
choose("q[online_eq]")
|
23
|
+
expect(product_count).to be 1
|
24
|
+
end
|
25
|
+
it "filters by empty summary" do
|
26
|
+
product_ab :summary =>[ "i have a summary", ""]
|
27
|
+
choose("q[summary_blank]")
|
28
|
+
expect(product_count).to be 1
|
29
|
+
end
|
30
|
+
it "filters by summary" do
|
31
|
+
product_ab :summary =>[ "i have a summary", ""]
|
32
|
+
fill_in("q[summary_cont]" , :with => "have")
|
33
|
+
expect(product_count).to be 1
|
34
|
+
end
|
35
|
+
it "filters by empty description" do
|
36
|
+
product_ab :description =>[ "i have a description", ""]
|
37
|
+
choose("q[description_blank]")
|
38
|
+
expect(product_count).to be 1
|
39
|
+
end
|
40
|
+
it "filters by description" do
|
41
|
+
product_ab :description =>[ "i have a name", "nono"]
|
42
|
+
fill_in("q[description_cont]" , :with => "name")
|
43
|
+
expect(product_count).to be 1
|
44
|
+
end
|
45
|
+
it "filters by price less" do
|
46
|
+
product_ab :price => [8 ,12]
|
47
|
+
fill_in "q[price_lteq]", :with => '10'
|
48
|
+
expect(product_count).to be 1
|
49
|
+
end
|
50
|
+
it "filters by price greater" do
|
51
|
+
product_ab :price => [8 ,12]
|
52
|
+
fill_in "q[price_gteq]", :with => '10'
|
53
|
+
expect(product_count).to be 1
|
54
|
+
end
|
55
|
+
it "filters by stock less" do
|
56
|
+
product_ab :inventory => [8 ,12]
|
57
|
+
fill_in "q[inventory_lteq]", :with => '10'
|
58
|
+
expect(product_count).to be 1
|
59
|
+
end
|
60
|
+
it "filters by inventory greater" do
|
61
|
+
product_ab :inventory => [8 ,12]
|
62
|
+
fill_in "q[inventory_gteq]", :with => '10'
|
63
|
+
expect(product_count).to be 1
|
64
|
+
end
|
16
65
|
end
|