spec/models/kawara/article_image_spec.rb in kawara-0.2.0 vs spec/models/kawara/article_image_spec.rb in kawara-0.3.0
- old
+ new
@@ -9,10 +9,12 @@
describe 'validations' do
it { should validate_presence_of(:article) }
end
describe '#file' do
- let(:image) { build :kawara_article_image }
+ let(:site) { create :opened_site_a }
+ let(:article) { create :published_article, site: site }
+ let(:image) { build :kawara_article_image, site: site, article: article }
it 'uploads a file' do
image.file = Refile::FileDouble.new("dummy", "logo.png", content_type: "image/png")
image.save
expect(image.file.id).to_not be_nil