spec/models/attachy/viewer/image_spec.rb in attachy-0.1.2 vs spec/models/attachy/viewer/image_spec.rb in attachy-0.2.0
- old
+ new
@@ -1,8 +1,12 @@
+# frozen_string_literal: true
+
require 'rails_helper'
RSpec.describe Attachy::Viewer, '.image' 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 }
context 'when :html is present' do
let!(:html_attributes) { { alt: :alt, invalid: :invalid, height: 11, width: 22 } }
context 'and :t is blank' do