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

- old
+ new

@@ -1,8 +1,12 @@ +# frozen_string_literal: true + require 'rails_helper' RSpec.describe Attachy::Viewer, '.field' do + subject { described_class.new method, object, options } + let!(:method) { :avatar } let!(:object) { create :user } let!(:options) { { button: { html: { key: :value } } } } let!(:file) do @@ -13,11 +17,9 @@ before do allow(subject).to receive(:content) { '1' } allow(subject).to receive(:file_button) { '2' } end - - subject { described_class.new method, object, options } describe 'default options' do it 'uses generic button options' do el = subject.field