Skip to content

Commit

Permalink
Merge pull request #64 from alphagov/govnamefix
Browse files Browse the repository at this point in the history
Correct misleading spec for `government_name`
  • Loading branch information
csutter authored Oct 26, 2023
2 parents 077f00d + 1615bfe commit f0c3c1e
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions spec/lib/document_sync_worker/document/publish_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,31 +345,18 @@
describe "government_name" do
subject(:extracted_government_name) { document.metadata[:government_name] }

context "when the document is non-political" do
let(:document_hash) { { "details" => {} } }
let(:document_hash) { { "expanded_links" => expanded_links } }

context "without link to a government" do
let(:expanded_links) { {} }

it { is_expected.to be_nil }
end

context "when the document is political" do
let(:document_hash) do
{
"details" => { "political" => true },
"expanded_links" => expanded_links,
}
end

context "without link to a government" do
let(:expanded_links) { {} }
context "with a link to a government" do
let(:expanded_links) { { "government" => [{ "title" => "2096 Something Party government" }] } }

it { is_expected.to be_nil }
end

context "with a link to a government" do
let(:expanded_links) { { "government" => [{ "title" => "2096 Something Party government" }] } }

it { is_expected.to eq("2096 Something Party government") }
end
it { is_expected.to eq("2096 Something Party government") }
end
end

Expand Down

0 comments on commit f0c3c1e

Please sign in to comment.