spec/models/attachy/viewer/link_spec.rb in attachy-0.1.2 vs spec/models/attachy/viewer/link_spec.rb in attachy-0.2.0

- old
+ new

@@ -1,8 +1,12 @@ +# frozen_string_literal: true + require 'rails_helper' RSpec.describe Attachy::Viewer, '.link' do + subject { described_class.new method, object, options } + let!(:method) { :avatar } let!(:object) { create :user } let!(:default_html) { { alt: :image, height: 50, width: 150 } } let!(:default_t) { { height: 100, width: 200 } } let!(:options) { { t: default_t, html: default_html } } @@ -10,11 +14,9 @@ let!(:file) do allow(Cloudinary::Uploader).to receive(:remove_tag) create :file, attachable: object end - - subject { described_class.new method, object, options } describe 'default options' do before do allow_any_instance_of(Attachy::File).to receive(:url).with(crop: :none) { 'http://example.org' } end