spec/article_spec.rb in reviewed-0.1.31 vs spec/article_spec.rb in reviewed-0.1.32
- old
+ new
@@ -65,11 +65,11 @@
describe 'find_page', vcr: true do
it 'finds a page with a matching slug' do
article = client.articles.find('minden-master-ii-grill-review')
- article.pages.length.should == 5
+ article.pages.length.should == 4
page = article.find_page('performance')
page.should == article.pages[2]
page.name.should == 'Performance'
end
end
@@ -86,8 +86,13 @@
@product.name.should eql('Big Green Egg Medium')
end
it "returns a product of the correct class" do
@product.class.should == Reviewed::Product
+ end
+
+ it 'returns nil if does not respond to products' do
+ @article.attributes.delete(:products)
+ @article.primary_product.should be_nil
end
end
end