File tree 2 files changed +31
-0
lines changed
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -40,4 +40,12 @@ def source_edition_publication_event
40
40
def source_edition
41
41
@source_edition ||= Document . find_by ( content_id :) . live
42
42
end
43
+
44
+ def dependencies
45
+ Queries ::ContentDependencies . new (
46
+ content_id :,
47
+ locale : Edition ::DEFAULT_LOCALE ,
48
+ content_stores :,
49
+ ) . call
50
+ end
43
51
end
Original file line number Diff line number Diff line change 63
63
expect ( event . payload [ :source_block ] [ :updated_by_user_uid ] ) . to eq ( latest_publish_event . user_uid )
64
64
expect ( event . payload [ :message ] ) . to eq ( "Host content updated by content block update" )
65
65
end
66
+
67
+ describe "when the locale is a non-English locale" do
68
+ subject ( :worker_perform ) do
69
+ described_class . new . perform (
70
+ "content_id" => content_id ,
71
+ "locale" => "cy" ,
72
+ "content_store" => "Adapters::ContentStore" ,
73
+ "orphaned_content_ids" => [ ] ,
74
+ )
75
+ end
76
+
77
+ let ( :edition_dependee ) { double ( :edition_dependent , call : [ ] ) }
78
+
79
+ it "searches in the default locale" do
80
+ expect ( Queries ::ContentDependencies ) . to receive ( :new ) . with (
81
+ content_id :,
82
+ locale : Edition ::DEFAULT_LOCALE ,
83
+ content_stores : %w[ live ] ,
84
+ ) . and_return ( edition_dependee )
85
+
86
+ worker_perform
87
+ end
88
+ end
66
89
end
You can’t perform that action at this time.
0 commit comments