spec/article_spec.rb in reviewed-0.5.0 vs spec/article_spec.rb in reviewed-0.6.0

- old
+ new

@@ -5,10 +5,11 @@ let(:client) do Reviewed::Client.new(api_key: TEST_KEY, base_uri: TEST_URL) end before(:each) do + Faraday::Cache.store.clear @article = client.articles.find('big-green-egg-medium-charcoal-grill-review', { with_attachments: true }) end describe 'associations', vcr: true do @@ -61,14 +62,11 @@ attachment.should be_an_instance_of(Reviewed::Attachment) end end it 'finds attachments by tag' do - attachments = @article.attachments('old-hero') - attachments.length.should == 1 - attachments.each do |attachment| - attachment.tags.join(',').should match(/hero/i) - end + attachments = @article.attachments('hero') + attachments.map(&:tags).flatten.should == ['hero'] end it 'does not have any matching attachments' do attachments = @article.attachments('doesnotcompute') attachments.length.should == 0