ur-product 0.8 → 0.9
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.
- data/features/product.feature +5 -1
- data/features/step_definitions/product_steps.rb +16 -0
- data/features/support/env.rb +2 -1
- data/lib/ur/metadata_cache.rb +1 -1
- data/lib/ur/product.rb +8 -0
- data/lib/ur/search.rb +1 -1
- metadata +3 -3
data/features/product.feature
CHANGED
|
@@ -24,4 +24,8 @@ Feature: UR Product
|
|
|
24
24
|
Scenario: Check if a product has an image
|
|
25
25
|
Given I want the product 100001
|
|
26
26
|
When I get the product
|
|
27
|
-
Then it should have image
|
|
27
|
+
Then it should have image
|
|
28
|
+
|
|
29
|
+
# Scenario: Boolean search for sab:H* should return 3 or more hits
|
|
30
|
+
# Given I search for "sab:H*"
|
|
31
|
+
# Then I should get 3 or more hits
|
|
@@ -22,6 +22,22 @@ Given /^I want the products (.+)$/ do |ids|
|
|
|
22
22
|
@ids = ids.split(' and ')
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
Given /^I search for "([^\"]*)"$/ do |query|
|
|
26
|
+
@search = UR::Product.search({
|
|
27
|
+
:per_page => 10,
|
|
28
|
+
:qt => 'internalfacets',
|
|
29
|
+
:defType => 'lucene',
|
|
30
|
+
:q => query
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
puts @search.inspect
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
Then /^I should get (\d+) or more hits$/ do |num_hits|
|
|
38
|
+
@search.num_hits.should >= num_hits
|
|
39
|
+
end
|
|
40
|
+
|
|
25
41
|
# When
|
|
26
42
|
|
|
27
43
|
When /^I get the product$/ do
|
data/features/support/env.rb
CHANGED
|
@@ -8,7 +8,8 @@ FakeWeb.allow_net_connect = false
|
|
|
8
8
|
faked_urls = [
|
|
9
9
|
'http://metadata.ur.se/products/100001.json',
|
|
10
10
|
'http://metadata.ur.se/products.json?ur_product_ids=100001,150423',
|
|
11
|
-
'http://assets.ur.se/id/100001/images/1.jpg'
|
|
11
|
+
'http://assets.ur.se/id/100001/images/1.jpg',
|
|
12
|
+
'http://services.ur.se/search/select?qt=internalfacets&wt=ruby&defType=lucene&q=sab%3AH%2A&rows=10'
|
|
12
13
|
]
|
|
13
14
|
|
|
14
15
|
faked_urls.each do |url|
|
data/lib/ur/metadata_cache.rb
CHANGED
data/lib/ur/product.rb
CHANGED
data/lib/ur/search.rb
CHANGED
metadata
CHANGED
|
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
|
|
|
4
4
|
prerelease: false
|
|
5
5
|
segments:
|
|
6
6
|
- 0
|
|
7
|
-
-
|
|
8
|
-
version: "0.
|
|
7
|
+
- 9
|
|
8
|
+
version: "0.9"
|
|
9
9
|
platform: ruby
|
|
10
10
|
authors:
|
|
11
11
|
- Peter Hellberg
|
|
@@ -13,7 +13,7 @@ autorequire:
|
|
|
13
13
|
bindir: bin
|
|
14
14
|
cert_chain: []
|
|
15
15
|
|
|
16
|
-
date: 2010-05-
|
|
16
|
+
date: 2010-05-25 00:00:00 +02:00
|
|
17
17
|
default_executable:
|
|
18
18
|
dependencies:
|
|
19
19
|
- !ruby/object:Gem::Dependency
|