active_fedora-crosswalks 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Y2RlNmUzYWMzNGIxNGIzNDA0MDY2M2NlNGVkNmE2ODllYjJlYWZmZA==
4
+ MTUyZTM3NzViNTgzZGQ1OGI3MWI1ZjVkMzEzM2MwMDJjMDI4NmMyMw==
5
5
  data.tar.gz: !binary |-
6
- MzY5OTE0NWIxZTZjMTI0NjJjZWEzMDQxNjM3YjI4NzMwYzY5MGFiNQ==
6
+ OTMwZThhMjljNTRlMWFlNzQxYmVlMGZlNjdkMDZjNGVmNzVlZTA2MQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OGQ1MGQxYzg0ZjgwOTQyY2IyNjY4MGIyOGNiMTQxYzViZTk0NDVmMGFhZTM5
10
- MzZkODJlYzM0YzM0YzkxZWY3NTY0NWE4MTkwOTRkZGMyNzVjYzQ1MmY4NzJj
11
- ODM4OWNlYTgzY2I0YjJiNjBmZDliMzYyMjMzODMyNDczOWU2ZjI=
9
+ YzYzYmM1MzA0YmQ0NWU1MGE1NmY3YjFhNGEwYWUyZWMyM2JiMzIyMjk0ZWFi
10
+ ZmUyZWM4MTI5YzNhNjg2ZWIxMGU4ZmNiM2U0NDRjNmQxZWViNzcxOGMxOTcw
11
+ Yjc3OGYzZWFmZjY1N2E2NzQ4ZmUzNDhiOTYyNjdiYWI1MTM3OGE=
12
12
  data.tar.gz: !binary |-
13
- MThlNWI0MWQ2NmY4OTc0N2M1Y2Q2ZTMyYTY0YTA0MDc0YmZhOWJmMmNkZTBm
14
- N2YyZmVlNDQ1ZjhkYTMxMzY0MWE0OGFkMjNkMjcyNGQ4ZWM2YWM3YWUzZjhi
15
- YTYzMDQxYzlkNTU5OTZkOGI3ZDM0YjJjMWIwM2VkMzczNGM5MjE=
13
+ YjU4MTM2MjJmMzYwNmFmOTE4NWE1MGY2YzRkMDEwNWI3OWYxMTI2ZWVlYmJh
14
+ ZmZlMzQ4MjA4NWVlZjA5OGIyNjcxY2UxMmMzNmE4MDgyMjIxYmMyNzg4Y2Ri
15
+ ZjgwYzExZWZlMTVjM2EwY2JlYWZlYTJhOTFkMmU5NjY4YWYxYmY=
@@ -4,10 +4,17 @@ module ActiveFedora
4
4
  # Override content so when it's called it performs crosswalks first.
5
5
  def content
6
6
  crosswalkers.each do |crosswalker|
7
- crosswalker.source_accessor.get_value
7
+ crosswalker.sync_values
8
8
  end
9
9
  super
10
10
  end
11
+ def content=(*args)
12
+ result = super(*args)
13
+ crosswalkers.each do |crosswalker|
14
+ crosswalker.sync_values(:force_target => true)
15
+ end
16
+ return result
17
+ end
11
18
  def crosswalk_fields
12
19
  @crosswalk_fields ||= []
13
20
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveFedora
2
2
  module Crosswalks
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
@@ -19,6 +19,30 @@ describe ActiveFedora::Crosswalks::Crosswalkable do
19
19
  it "should be able to reload" do
20
20
  expect {asset.load_datastreams}.not_to raise_error
21
21
  end
22
+ context "when content is set directly" do
23
+ context "on the crosswalk datastream" do
24
+ before(:each) do
25
+ asset.xwalkMetadata.title = "Test"
26
+ old_content = asset.xwalkMetadata.content
27
+ asset.xwalkMetadata.title = "Testing"
28
+ asset.xwalkMetadata.content = old_content
29
+ end
30
+ it "should set the source datastream" do
31
+ expect(asset.descMetadata.other_title).to eq ["Test"]
32
+ end
33
+ end
34
+ context "on the source datastream" do
35
+ before(:each) do
36
+ asset.descMetadata.other_title = "Test"
37
+ old_content = asset.descMetadata.content
38
+ asset.descMetadata.other_title = "Testing"
39
+ asset.descMetadata.content = old_content
40
+ end
41
+ it "should set the crosswalked datastream" do
42
+ expect(asset.xwalkMetadata.title).to eq ["Test"]
43
+ end
44
+ end
45
+ end
22
46
  context "when a field is set" do
23
47
  context "on the source datastream" do
24
48
  before(:each) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_fedora-crosswalks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trey Terrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-09 00:00:00.000000000 Z
11
+ date: 2013-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler