Sha256: 7d78b1009d2b38f5a56435e866af5d0211fc1bd4cae80422de929379a650aa9b

Contents?: true

Size: 665 Bytes

Versions: 4

Compression:

Stored size: 665 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe Attachy::Viewer, '.nodes' do
  subject { described_class.new method, object }

  let!(:object) { create :user }
  let!(:method) { :photos }
  let(:file_1)  { create :file, attachable: object, scope: method }
  let(:file_2)  { create :file, attachable: object, scope: method }

  before do
    allow(Cloudinary::Uploader).to receive(:remove_tag)

    allow(subject).to receive(:node).with(file_1) { :node_1 }
    allow(subject).to receive(:node).with(file_2) { :node_2 }
  end

  it 'returns the nodes with links inside as an array' do
    expect(subject.nodes).to eq %i[node_1 node_2]
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
attachy-0.4.1 spec/models/attachy/viewer/nodes_spec.rb
attachy-0.4.0 spec/models/attachy/viewer/nodes_spec.rb
attachy-0.3.0 spec/models/attachy/viewer/nodes_spec.rb
attachy-0.2.0 spec/models/attachy/viewer/nodes_spec.rb