Skip to content

Commit

Permalink
Remove dependency on Assemblable
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Feb 8, 2019
1 parent 44dd345 commit 9e90be0
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions spec/controllers/objects_controller_spec.rb
Expand Up @@ -5,7 +5,7 @@
login
end

let(:item) { AssembleableVersionableItem.new.tap { |x| x.pid = 'druid:aa123bb4567' } }
let(:item) { VersionableItem.new.tap { |x| x.pid = 'druid:aa123bb4567' } }

before do
allow(Dor).to receive(:find).and_return(item)
Expand Down Expand Up @@ -113,14 +113,14 @@

describe '/release_tags' do
it 'adds a release tag when posted to with false' do
expect(ReleaseTags).to receive(:create).with(AssembleableVersionableItem, release: false, to: 'searchworks', who: 'carrickr', what: 'self')
expect(ReleaseTags).to receive(:create).with(VersionableItem, release: false, to: 'searchworks', who: 'carrickr', what: 'self')
expect(item).to receive(:save)
post :release_tags, params: { id: item.pid }, body: %( {"to":"searchworks","who":"carrickr","what":"self","release":false} )
expect(response.status).to eq(201)
end

it 'adds a release tag when posted to with true' do
expect(ReleaseTags).to receive(:create).with(AssembleableVersionableItem, release: true, to: 'searchworks', who: 'carrickr', what: 'self')
expect(ReleaseTags).to receive(:create).with(VersionableItem, release: true, to: 'searchworks', who: 'carrickr', what: 'self')
expect(item).to receive(:save)
post :release_tags, params: { id: item.pid }, body: %( {"to":"searchworks","who":"carrickr","what":"self","release":true} )
expect(response.status).to eq(201)
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/sdr_controller_spec.rb
@@ -1,7 +1,7 @@
require 'rails_helper'

RSpec.describe SdrController do
let(:item) { AssembleableVersionableItem.new.tap { |x| x.pid = 'druid:aa123bb4567' } }
let(:item) { VersionableItem.new.tap { |x| x.pid = 'druid:aa123bb4567' } }

before do
allow(Dor).to receive(:find).and_return(item)
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/versions_controller_spec.rb
@@ -1,7 +1,7 @@
require 'rails_helper'

RSpec.describe VersionsController do
let(:item) { AssembleableVersionableItem.new.tap { |x| x.pid = 'druid:aa123bb4567' } }
let(:item) { VersionableItem.new.tap { |x| x.pid = 'druid:aa123bb4567' } }

before do
allow(Dor).to receive(:find).and_return(item)
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/workflows_controller_spec.rb
Expand Up @@ -21,7 +21,7 @@
end

describe 'workflow archiving' do
let(:item) { AssembleableVersionableItem.new.tap { |x| x.pid = 'druid:aa123bb4567' } }
let(:item) { VersionableItem.new.tap { |x| x.pid = 'druid:aa123bb4567' } }

before do
allow(Dor).to receive(:find).with(item.pid).and_return(item)
Expand Down
2 changes: 1 addition & 1 deletion spec/services/workspace_service_spec.rb
Expand Up @@ -23,7 +23,7 @@

describe '.create' do
let(:druid_path) { File.join(temp_workspace, 'aa', '123', 'bb', '7890', 'aa123bb7890') }
let(:work) { AssembleableVersionableItem.new.tap { |x| x.pid = 'druid:aa123bb7890' } }
let(:work) { VersionableItem.new.tap { |x| x.pid = 'druid:aa123bb7890' } }

before do
FileUtils.rm_rf(File.join(temp_workspace, 'aa'))
Expand Down
5 changes: 0 additions & 5 deletions spec/support/assembleable_versionable_item.rb

This file was deleted.

4 changes: 4 additions & 0 deletions spec/support/versionable_item.rb
@@ -0,0 +1,4 @@
class VersionableItem < ActiveFedora::Base
include Dor::Versionable
attr_accessor :pid
end

0 comments on commit 9e90be0

Please sign in to comment.