elibri_onix_mocks 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -131,8 +131,8 @@ module Elibri
|
|
131
131
|
:series_memberships => [
|
132
132
|
stub('SeriesMembership', :series_name => 'Lektury szkolne', :number_within_series => '2').extend(MockMethodMissing)
|
133
133
|
],
|
134
|
-
|
135
|
-
|
134
|
+
:facsimiles => [stub('Product', :publisher_name => 'PWN', :publisher_id => 12, :publisher_symbol => 'Tytuł dodruku', :isbn_value => '9788324705818', :record_reference => 'abcdefghijk')],
|
135
|
+
:similar_products => [stub('Product', :publisher_name => 'WNT', :publisher_id => 13, :publisher_symbol => 'Tytuł podobnej książki', :isbn_value => '9788324799992', :record_reference => 'kjihgfedcba')],
|
136
136
|
:attachments => [
|
137
137
|
stub('ProductAttachment',
|
138
138
|
:id => 668,
|
@@ -581,8 +581,8 @@ module Elibri
|
|
581
581
|
|
582
582
|
def onix_related_products_example(options = {})
|
583
583
|
opt = {
|
584
|
-
|
585
|
-
|
584
|
+
:facsimiles => [stub('Product', :publisher_name => 'PWN', :publisher_id => 12, :publisher_symbol => 'Tytuł dodruku', :isbn_value => '9788324705818', :record_reference => 'abcdefghijk')],
|
585
|
+
:similar_products => [stub('Product', :publisher_name => 'WNT', :publisher_id => 13, :publisher_symbol => 'Tytuł podobnej książki', :isbn_value => '9788324799992', :record_reference => 'kjihgfedcba')]
|
586
586
|
}.merge(options)
|
587
587
|
basic_product.tap do |product|
|
588
588
|
product.stubs(
|
@@ -837,9 +837,9 @@ module Elibri
|
|
837
837
|
end
|
838
838
|
|
839
839
|
def product_with_similars_mock(options = {})
|
840
|
-
product_1 = Elibri::XmlMocks::Examples.book_example(:title => 'title_1')
|
840
|
+
product_1 = Elibri::XmlMocks::Examples.book_example(:title => 'title_1', :record_reference => 'fdb8fa072be774d97a95')
|
841
841
|
product_2 = Elibri::XmlMocks::Examples.book_example(:title => 'title_2', :isbn_value => '9788324799993', :record_reference => 'fdb8fa072be774d97a98')
|
842
|
-
Elibri::XmlMocks::Examples.book_example(:record_reference => 'fdb8fa072be774d97a99', :isbn_value => '9788324799990', :facsimiles => [product_1, product_2])
|
842
|
+
Elibri::XmlMocks::Examples.book_example(:record_reference => 'fdb8fa072be774d97a99', :isbn_value => '9788324799990', :facsimiles => [product_1, product_2], :similar_products => [])
|
843
843
|
end
|
844
844
|
|
845
845
|
end
|
@@ -15,8 +15,7 @@ describe Elibri::XmlMocks::Examples do
|
|
15
15
|
:onix_audiobook_extent_example, :onix_no_contributors_example, :onix_collective_work_example,
|
16
16
|
:onix_contributors_example, :onix_announced_product_example, :onix_preorder_product_example,
|
17
17
|
:onix_published_product_example, :onix_out_of_print_product_example, :onix_titles_example,
|
18
|
-
:onix_title_with_collection_example, :onix_texts_example,
|
19
|
-
# :onix_related_products_example, #temporarly disabled
|
18
|
+
:onix_title_with_collection_example, :onix_texts_example, :onix_related_products_example,
|
20
19
|
:onix_supply_details_example, :onix_series_memberships_example, :onix_supporting_resources_example,
|
21
20
|
:onix_elibri_extensions_example, :contributor_mock, :review_mock, :supply_detail_mock, :imprint_mock,
|
22
21
|
:description_mock, :product_attachment_mock, :paperclip_attachment_mock
|
@@ -247,16 +246,13 @@ describe Elibri::XmlMocks::Examples do
|
|
247
246
|
message.products.first.send(:front_cover).send(:link).should eq('http://elibri.com.pl/sciezka/do/pliku.png')
|
248
247
|
end
|
249
248
|
|
250
|
-
=begin
|
251
|
-
|
252
249
|
it "should create product with similars" do
|
253
250
|
product = Elibri::XmlMocks::Examples.product_with_similars_mock
|
254
251
|
message = Elibri::ONIX::Release_3_0::ONIXMessage.from_xml(Elibri::ONIX::XMLGenerator.new(product).to_s)
|
255
|
-
|
256
|
-
|
257
|
-
|
252
|
+
prd = message.products.first
|
253
|
+
prd.related_products.count.should eq(2)
|
254
|
+
prd.related_products[0].record_reference.should eq('fdb8fa072be774d97a95')
|
255
|
+
prd.related_products[1].record_reference.should eq('fdb8fa072be774d97a98')
|
258
256
|
end
|
259
257
|
|
260
|
-
=end
|
261
|
-
|
262
258
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elibri_onix_mocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 6
|
10
|
+
version: 0.1.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Piotr Szmielew
|