spec/lib/wp2middleman/post_spec.rb in wp2middleman-0.0.2 vs spec/lib/wp2middleman/post_spec.rb in wp2middleman-0.0.3
- old
+ new
@@ -26,10 +26,16 @@
subject { post_one.date_published }
it { is_expected.to eq "2012-06-08" }
end
+ describe "#date_time_published" do
+ subject { post_one.date_time_published }
+
+ it { is_expected.to eq "2012-06-08 03:21:41" }
+ end
+
describe "#status" do
subject { post_three.status }
it { is_expected.to eq "private" }
end
@@ -70,16 +76,16 @@
it { is_expected.to eq [] }
end
end
describe "#valid?" do
- def post(post_date: Date.new(2014,2,19), title: "Title", date_published: Date.new(2014,2,19), content: "content")
+ def post(post_date: Date.new(2014,2,19), title: "Title", date_time_published: Time.new(2014,2,19,1,2,3), content: "content")
post = WP2Middleman::Post.new(double)
allow(post).to receive(:post_date) { post_date }
allow(post).to receive(:title) { title }
- allow(post).to receive(:date_published) { date_published }
+ allow(post).to receive(:date_time_published) { date_time_published }
allow(post).to receive(:content) { content }
post
end
@@ -94,10 +100,10 @@
it "is not valid without a title" do
expect(post(title: nil)).to_not be_valid
end
it "is not valid without a date_published" do
- expect(post(date_published: nil)).to_not be_valid
+ expect(post(date_time_published: nil)).to_not be_valid
end
it "is not valid without content" do
expect(post(content: nil)).to_not be_valid
end