Skip to content

Commit

Permalink
use FactoryGirl for image
Browse files Browse the repository at this point in the history
  • Loading branch information
lsat12357 committed Jan 4, 2019
1 parent 0198852 commit f83543b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions spec/controllers/oembed_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@
end
end
context 'if asset has an image file' do
let(:image) { Image.new }
let(:img) {{'width'=> 550, 'height'=>550}}
let(:image) { image = FactoryGirl.create(:image, :with_jpeg_datastream) }
before do
image.title = "my image"
image.create_derivatives
image.review
image.save
allow(File).to receive(:exist?).and_return(true)
allow(MiniMagick::Image).to receive(:open).and_return(img)
visit("#{APP_CONFIG['default_url_host']}/oembed/?format=json&url=#{APP_CONFIG['default_url_host']}/resource/#{image.pid}")
end
it 'should have content' do
Expand Down

0 comments on commit f83543b

Please sign in to comment.