Skip to content

Commit

Permalink
Use convenience test factories
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasleese authored and kevindew committed Dec 21, 2016
1 parent 814ac6b commit c0b21f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
3 changes: 1 addition & 2 deletions spec/presenters/queries/content_item_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,11 @@

context "with a blocking content item" do
before do
@blocking_content_item = FactoryGirl.create(:content_item,
@blocking_content_item = FactoryGirl.create(:live_content_item,
content_id: SecureRandom.uuid,
base_path: base_path,
user_facing_version: 1,
locale: "en",
state: "published",
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

context "with a single content item" do
before do
FactoryGirl.create(:content_item,
FactoryGirl.create(:draft_content_item,
content_id: content_id,
base_path: base_path,
document_type: document_type,
Expand All @@ -30,15 +30,15 @@

context "with two content items of different locales" do
before do
FactoryGirl.create(:content_item,
FactoryGirl.create(:draft_content_item,
content_id: content_id,
base_path: base_path + ".en",
document_type: document_type,
user_facing_version: 1,
locale: "en",
)

FactoryGirl.create(:content_item,
FactoryGirl.create(:draft_content_item,
content_id: content_id,
base_path: base_path + ".es",
document_type: document_type,
Expand All @@ -61,7 +61,7 @@
locale: "en",
)

FactoryGirl.create(:content_item,
FactoryGirl.create(:draft_content_item,
content_id: content_id,
base_path: base_path,
document_type: document_type,
Expand All @@ -75,16 +75,15 @@

context "with a published item, with a substitutable document_type, and a draft at the same base path" do
before do
FactoryGirl.create(:content_item,
FactoryGirl.create(:live_content_item,
content_id: SecureRandom.uuid,
base_path: base_path,
document_type: "unpublishing",
state: "published",
user_facing_version: 1,
locale: "en",
)

FactoryGirl.create(:content_item,
FactoryGirl.create(:draft_content_item,
content_id: content_id,
base_path: base_path,
document_type: document_type,
Expand All @@ -100,16 +99,15 @@
let(:document_type) { "unpublishing" }

before do
FactoryGirl.create(:content_item,
FactoryGirl.create(:live_content_item,
content_id: SecureRandom.uuid,
base_path: base_path,
document_type: "guide",
state: "published",
user_facing_version: 1,
locale: "en",
)

FactoryGirl.create(:content_item,
FactoryGirl.create(:draft_content_item,
content_id: content_id,
base_path: base_path,
document_type: document_type,
Expand Down Expand Up @@ -147,16 +145,15 @@

context "with a published item, and a draft at the same base path" do
before do
@blocking_content_item = FactoryGirl.create(:content_item,
@blocking_content_item = FactoryGirl.create(:live_content_item,
content_id: SecureRandom.uuid,
base_path: base_path,
document_type: document_type,
state: "published",
user_facing_version: 1,
locale: "en",
)

FactoryGirl.create(:content_item,
FactoryGirl.create(:draft_content_item,
content_id: content_id,
base_path: base_path,
document_type: document_type,
Expand Down

0 comments on commit c0b21f5

Please sign in to comment.