Sha256: fcbe31970e4d2914481c604e4e1e75e7cd337bbf799332cab89fab1f2a3aa68e

Contents?: true

Size: 992 Bytes

Versions: 1

Compression:

Stored size: 992 Bytes

Contents

require 'spec_helper'

describe Sufia::Export::VersionGraphConverter do
  let(:file) { create :generic_file, :with_content, id: 'abc123' }
  let(:graph) { file.content.versions }
  let(:version1) { graph.all.first }
  let(:version2) { graph.all.last }
  let(:created1) { version1.created }
  let(:created2) { version2.created }
  let(:json) { "{\"versions\":[{\"uri\":\"http://localhost:8983/fedora/rest/test/ab/c1/23/abc123/content/fcr:versions/version1\",\"created\":\"#{created1}\",\"label\":\"version1\"},{\"uri\":\"http://localhost:8983/fedora/rest/test/ab/c1/23/abc123/content/fcr:versions/version2\",\"created\":\"#{created2}\",\"label\":\"version2\"}]}" }
  let(:user) { FactoryGirl.create(:user) }

  subject { described_class.new(graph).to_json }

  # add a second version
  before do
    file.add_file(File.open(fixture_path + '/small_file.txt'), path: 'content', original_name: 'test2.png')
    file.save
  end

  describe "to_json" do
    it { is_expected.to eq json }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sufia-6.7.0 spec/lib/sufia/export/version_graph_converter_spec.rb