hydra-collections 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -7
- data/Changelog.md +25 -1
- data/Gemfile +3 -2
- data/app/controllers/concerns/hydra/collections_controller_behavior.rb +38 -41
- data/app/models/concerns/hydra/collection.rb +11 -36
- data/hydra-collections.gemspec +1 -1
- data/lib/hydra/collections/version.rb +1 -1
- data/spec/controllers/accepts_batches_spec.rb +18 -20
- data/spec/controllers/catalog_controller_spec.rb +3 -3
- data/spec/controllers/collections_controller_spec.rb +107 -87
- data/spec/controllers/other_collections_controller_spec.rb +9 -9
- data/spec/controllers/selects_collections_spec.rb +17 -17
- data/spec/helpers/collections_helper_spec.rb +23 -23
- data/spec/helpers/collections_search_helper_spec.rb +3 -3
- data/spec/lib/collectible_spec.rb +3 -3
- data/spec/lib/search_service_spec.rb +6 -6
- data/spec/models/collection_spec.rb +31 -20
- data/spec/spec_helper.rb +0 -1
- metadata +20 -23
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
@@ -34,7 +34,7 @@ class Member < ActiveFedora::Base
|
|
34
34
|
end
|
35
35
|
|
36
36
|
# make sure a collection by another name still assigns the @collection variable
|
37
|
-
describe OtherCollectionsController do
|
37
|
+
describe OtherCollectionsController, :type => :controller do
|
38
38
|
before(:all) do
|
39
39
|
@user = FactoryGirl.find_or_create(:user)
|
40
40
|
end
|
@@ -49,12 +49,12 @@ describe OtherCollectionsController do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
before do
|
52
|
-
controller.
|
52
|
+
allow(controller).to receive(:has_access?).and_return(true)
|
53
53
|
|
54
54
|
@user = FactoryGirl.find_or_create(:user)
|
55
55
|
sign_in @user
|
56
|
-
User.
|
57
|
-
controller.
|
56
|
+
allow_any_instance_of(User).to receive(:groups).and_return([])
|
57
|
+
allow(controller).to receive(:clear_session_user) ## Don't clear out the authenticated session
|
58
58
|
end
|
59
59
|
|
60
60
|
describe "#show" do
|
@@ -68,7 +68,7 @@ describe OtherCollectionsController do
|
|
68
68
|
collection.apply_depositor_metadata(@user.user_key)
|
69
69
|
collection.members = [asset1,asset2,asset3]
|
70
70
|
collection.save
|
71
|
-
controller.
|
71
|
+
allow(controller).to receive(:apply_gated_search)
|
72
72
|
end
|
73
73
|
after do
|
74
74
|
Rails.application.reload_routes!
|
@@ -76,11 +76,11 @@ describe OtherCollectionsController do
|
|
76
76
|
it "should show the collections" do
|
77
77
|
routes.draw { resources :other_collections, except: :index }
|
78
78
|
get :show, id: collection.id
|
79
|
-
assigns[:collection].title.
|
79
|
+
expect(assigns[:collection].title).to eq(collection.title)
|
80
80
|
ids = assigns[:member_docs].map {|d| d.id}
|
81
|
-
ids.
|
82
|
-
ids.
|
83
|
-
ids.
|
81
|
+
expect(ids).to include asset1.pid
|
82
|
+
expect(ids).to include asset2.pid
|
83
|
+
expect(ids).to include asset3.pid
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
@@ -10,15 +10,15 @@ class SelectsCollectionsController < ApplicationController
|
|
10
10
|
end
|
11
11
|
|
12
12
|
|
13
|
-
describe SelectsCollectionsController do
|
13
|
+
describe SelectsCollectionsController, :type => :controller do
|
14
14
|
|
15
15
|
describe "#find_collections" do
|
16
16
|
it "should override solr_search_params_logic to use collection_search_params_logic, then switch it back" do
|
17
17
|
# Looks like we can only test this indirectly b/c blacklight doesn't let you explicitly pass solr_search_params_logic when running searches -- you have to set the controller's solr_search_params_logic class attribute
|
18
18
|
original_solr_logic = subject.solr_search_params_logic
|
19
|
-
subject.collection_search_params_logic.
|
20
|
-
subject.class.
|
21
|
-
subject.class.
|
19
|
+
expect(subject.collection_search_params_logic).to eq([:default_solr_parameters, :add_query_to_solr, :add_access_controls_to_solr_params, :add_collection_filter])
|
20
|
+
expect(subject.class).to receive(:solr_search_params_logic=).with(subject.collection_search_params_logic)
|
21
|
+
expect(subject.class).to receive(:solr_search_params_logic=).with(original_solr_logic)
|
22
22
|
subject.find_collections
|
23
23
|
end
|
24
24
|
end
|
@@ -60,15 +60,15 @@ describe SelectsCollectionsController do
|
|
60
60
|
expect(@user_collections).to be_kind_of(Array)
|
61
61
|
end
|
62
62
|
it "should return public collections" do
|
63
|
-
@user_collections.index{|d| d.id == @collection.id}.
|
63
|
+
expect(@user_collections.index{|d| d.id == @collection.id}).not_to be_nil
|
64
64
|
end
|
65
65
|
it "should return all public collections" do
|
66
|
-
@user_collections.count.
|
66
|
+
expect(@user_collections.count).to eq(12)
|
67
67
|
end
|
68
68
|
it "should not return non public collections" do
|
69
|
-
@user_collections.index{|d| d.id == @collection2.id}.
|
70
|
-
@user_collections.index{|d| d.id == @collection3.id}.
|
71
|
-
@user_collections.index{|d| d.id == @collection4.id}.
|
69
|
+
expect(@user_collections.index{|d| d.id == @collection2.id}).to be_nil
|
70
|
+
expect(@user_collections.index{|d| d.id == @collection3.id}).to be_nil
|
71
|
+
expect(@user_collections.index{|d| d.id == @collection4.id}).to be_nil
|
72
72
|
end
|
73
73
|
end
|
74
74
|
describe "Read Access" do
|
@@ -85,12 +85,12 @@ describe SelectsCollectionsController do
|
|
85
85
|
expect(@user_collections).to be_kind_of(Array)
|
86
86
|
end
|
87
87
|
it "should return public and read access (edit access implies read) collections" do
|
88
|
-
@user_collections.index{|d| d.id == @collection.id}.
|
89
|
-
@user_collections.index{|d| d.id == @collection2.id}.
|
90
|
-
@user_collections.index{|d| d.id == @collection3.id}.
|
88
|
+
expect(@user_collections.index{|d| d.id == @collection.id}).not_to be_nil
|
89
|
+
expect(@user_collections.index{|d| d.id == @collection2.id}).not_to be_nil
|
90
|
+
expect(@user_collections.index{|d| d.id == @collection3.id}).not_to be_nil
|
91
91
|
end
|
92
92
|
it "should not return non public collections" do
|
93
|
-
@user_collections.index{|d| d.id == @collection4.id}.
|
93
|
+
expect(@user_collections.index{|d| d.id == @collection4.id}).to be_nil
|
94
94
|
end
|
95
95
|
end
|
96
96
|
end
|
@@ -108,12 +108,12 @@ describe SelectsCollectionsController do
|
|
108
108
|
expect(@user_collections).to be_kind_of(Array)
|
109
109
|
end
|
110
110
|
it "should return public or editable collections" do
|
111
|
-
@user_collections.index{|d| d.id == @collection.id}.
|
112
|
-
@user_collections.index{|d| d.id == @collection3.id}.
|
111
|
+
expect(@user_collections.index{|d| d.id == @collection.id}).not_to be_nil
|
112
|
+
expect(@user_collections.index{|d| d.id == @collection3.id}).not_to be_nil
|
113
113
|
end
|
114
114
|
it "should not return non public or editable collections" do
|
115
|
-
@user_collections.index{|d| d.id == @collection2.id}.
|
116
|
-
@user_collections.index{|d| d.id == @collection4.id}.
|
115
|
+
expect(@user_collections.index{|d| d.id == @collection2.id}).to be_nil
|
116
|
+
expect(@user_collections.index{|d| d.id == @collection4.id}).to be_nil
|
117
117
|
end
|
118
118
|
end
|
119
119
|
end
|
@@ -2,23 +2,23 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
include Hydra::Collections::Engine.routes.url_helpers
|
4
4
|
|
5
|
-
describe CollectionsHelper do
|
5
|
+
describe CollectionsHelper, :type => :helper do
|
6
6
|
describe "button_for_create_collection" do
|
7
7
|
it " should create a button to the collections new path" do
|
8
8
|
str = String.new(helper.button_for_create_collection)
|
9
9
|
doc = Nokogiri::HTML(str)
|
10
10
|
form = doc.xpath('//form').first
|
11
|
-
form.attr('action').
|
11
|
+
expect(form.attr('action')).to eq("#{collections.new_collection_path}")
|
12
12
|
i = form.children.first.children.first
|
13
|
-
i.attr('type').
|
13
|
+
expect(i.attr('type')).to eq('submit')
|
14
14
|
end
|
15
15
|
it "should create a button with my text" do
|
16
16
|
str = String.new(helper.button_for_create_collection "Create My Button")
|
17
17
|
doc = Nokogiri::HTML(str)
|
18
18
|
form = doc.xpath('//form').first
|
19
|
-
form.attr('action').
|
19
|
+
expect(form.attr('action')).to eq("#{collections.new_collection_path}")
|
20
20
|
i = form.children.first.children.first
|
21
|
-
i.attr('value').
|
21
|
+
expect(i.attr('value')).to eq('Create My Button')
|
22
22
|
end
|
23
23
|
end
|
24
24
|
describe "button_for_delete_collection" do
|
@@ -32,17 +32,17 @@ describe CollectionsHelper do
|
|
32
32
|
str = button_for_delete_collection @collection
|
33
33
|
doc = Nokogiri::HTML(str)
|
34
34
|
form = doc.xpath('//form').first
|
35
|
-
form.attr('action').
|
35
|
+
expect(form.attr('action')).to eq("#{collections.collection_path(@collection.pid)}")
|
36
36
|
i = form.children.first.children[1]
|
37
|
-
i.attr('type').
|
37
|
+
expect(i.attr('type')).to eq('submit')
|
38
38
|
end
|
39
39
|
it "should create a button with my text" do
|
40
40
|
str = button_for_delete_collection @collection, "Delete My Button"
|
41
41
|
doc = Nokogiri::HTML(str)
|
42
42
|
form = doc.xpath('//form').first
|
43
|
-
form.attr('action').
|
43
|
+
expect(form.attr('action')).to eq("#{collections.collection_path(@collection.pid)}")
|
44
44
|
i = form.children.first.children[1]
|
45
|
-
i.attr('value').
|
45
|
+
expect(i.attr('value')).to eq("Delete My Button")
|
46
46
|
end
|
47
47
|
end
|
48
48
|
describe "button_for_remove_from_collection" do
|
@@ -55,9 +55,9 @@ describe CollectionsHelper do
|
|
55
55
|
str = button_for_remove_from_collection item
|
56
56
|
doc = Nokogiri::HTML(str)
|
57
57
|
form = doc.xpath('//form').first
|
58
|
-
form.attr('action').
|
59
|
-
form.css('input#collection_members[type="hidden"][value="remove"]').
|
60
|
-
form.css('input[type="hidden"][name="batch_document_ids[]"][value="changeme:123"]').
|
58
|
+
expect(form.attr('action')).to eq("#{collections.collection_path(@collection.pid)}")
|
59
|
+
expect(form.css('input#collection_members[type="hidden"][value="remove"]')).not_to be_empty
|
60
|
+
expect(form.css('input[type="hidden"][name="batch_document_ids[]"][value="changeme:123"]')).not_to be_empty
|
61
61
|
end
|
62
62
|
|
63
63
|
describe "for a collection of another name" do
|
@@ -77,9 +77,9 @@ describe CollectionsHelper do
|
|
77
77
|
str = button_for_remove_from_collection item
|
78
78
|
doc = Nokogiri::HTML(str)
|
79
79
|
form = doc.xpath('//form').first
|
80
|
-
form.attr('action').
|
81
|
-
form.css('input#collection_members[type="hidden"][value="remove"]').
|
82
|
-
form.css('input[type="hidden"][name="batch_document_ids[]"][value="changeme:123"]').
|
80
|
+
expect(form.attr('action')).to eq("#{collections.collection_path(@collection.pid)}")
|
81
|
+
expect(form.css('input#collection_members[type="hidden"][value="remove"]')).not_to be_empty
|
82
|
+
expect(form.css('input[type="hidden"][name="batch_document_ids[]"][value="changeme:123"]')).not_to be_empty
|
83
83
|
end
|
84
84
|
|
85
85
|
end
|
@@ -95,18 +95,18 @@ describe CollectionsHelper do
|
|
95
95
|
str = button_for_remove_selected_from_collection @collection
|
96
96
|
doc = Nokogiri::HTML(str)
|
97
97
|
form = doc.xpath('//form').first
|
98
|
-
form.attr('action').
|
98
|
+
expect(form.attr('action')).to eq("#{collections.collection_path(@collection.pid)}")
|
99
99
|
i = form.children[2]
|
100
|
-
i.attr('value').
|
101
|
-
i.attr('name').
|
100
|
+
expect(i.attr('value')).to eq("remove")
|
101
|
+
expect(i.attr('name')).to eq("collection[members]")
|
102
102
|
end
|
103
103
|
it "should create a button with my text" do
|
104
104
|
str = button_for_remove_selected_from_collection @collection, "Remove My Button"
|
105
105
|
doc = Nokogiri::HTML(str)
|
106
106
|
form = doc.xpath('//form').first
|
107
|
-
form.attr('action').
|
107
|
+
expect(form.attr('action')).to eq("#{collections.collection_path(@collection.pid)}")
|
108
108
|
i = form.children[3]
|
109
|
-
i.attr('value').
|
109
|
+
expect(i.attr('value')).to eq("Remove My Button")
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
@@ -115,9 +115,9 @@ describe CollectionsHelper do
|
|
115
115
|
it "should make hidden fields" do
|
116
116
|
doc = Nokogiri::HTML(hidden_collection_members)
|
117
117
|
inputs = doc.xpath('//input[@type="hidden"][@name="batch_document_ids[]"]')
|
118
|
-
inputs.length.
|
119
|
-
inputs[0].attr('value').
|
120
|
-
inputs[1].attr('value').
|
118
|
+
expect(inputs.length).to eq(2)
|
119
|
+
expect(inputs[0].attr('value')).to eq('foo:12')
|
120
|
+
expect(inputs[1].attr('value')).to eq('foo:23')
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe CollectionsSearchHelper do
|
3
|
+
describe CollectionsSearchHelper, :type => :helper do
|
4
4
|
describe "collection_name" do
|
5
5
|
let (:collection_without_title) { Collection.create() }
|
6
6
|
let (:collection_with_title) { Collection.create(title: "Title of Collection 2") }
|
7
7
|
it "should return the pid if no title available" do
|
8
|
-
collection_name(collection_without_title.pid).
|
8
|
+
expect(collection_name(collection_without_title.pid)).to eq(collection_without_title.pid)
|
9
9
|
end
|
10
10
|
it "should return the title value associated with the given pid" do
|
11
|
-
collection_name(collection_with_title.pid).
|
11
|
+
expect(collection_name(collection_with_title.pid)).to eq("Title of Collection 2")
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -16,8 +16,8 @@ describe Hydra::Collections::Collectible do
|
|
16
16
|
@collection1.save
|
17
17
|
@collectible.collections << @collection2
|
18
18
|
reloaded = CollectibleThing.find(@collectible.pid)
|
19
|
-
@collection2.reload.members.
|
20
|
-
reloaded.collections.
|
19
|
+
expect(@collection2.reload.members).to eq([@collectible])
|
20
|
+
expect(reloaded.collections).to eq([@collection1, @collection2])
|
21
21
|
end
|
22
22
|
end
|
23
23
|
describe "index_collection_pids" do
|
@@ -25,7 +25,7 @@ describe Hydra::Collections::Collectible do
|
|
25
25
|
@collectible.save
|
26
26
|
@collectible.collections << @collection1
|
27
27
|
@collectible.collections << @collection2
|
28
|
-
@collectible.index_collection_pids["collection_sim"].
|
28
|
+
expect(@collectible.index_collection_pids["collection_sim"]).to eq([@collection1.pid, @collection2.pid])
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -8,19 +8,19 @@ describe Hydra::Collections::SearchService do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should get the documents for the first history entry" do
|
11
|
-
Search.
|
12
|
-
@service.
|
13
|
-
@service.last_search_documents.
|
11
|
+
expect(Search).to receive(:find).with(17).and_return(Search.new(:query_params=>{:q=>"World Peace"}))
|
12
|
+
expect(@service).to receive(:get_search_results).and_return([:one, [:doc1, :doc2]])
|
13
|
+
expect(@service.last_search_documents).to eq([:doc1, :doc2])
|
14
14
|
end
|
15
15
|
|
16
16
|
describe 'apply_gated_search' do
|
17
17
|
before(:each) do
|
18
|
-
RoleMapper.
|
18
|
+
allow(RoleMapper).to receive(:roles).with(@login).and_return(['umg/test.group.1'])
|
19
19
|
params = @service.apply_gated_search({}, {})
|
20
20
|
@group_query = params[:fq].first.split(' OR ')[1]
|
21
21
|
end
|
22
22
|
it "should escape slashes in groups" do
|
23
|
-
@group_query.
|
23
|
+
expect(@group_query).to eq('edit_access_group_ssim:umg\/test.group.1')
|
24
24
|
end
|
25
25
|
it "should allow overriding Solr's access control suffix" do
|
26
26
|
module Hydra
|
@@ -35,7 +35,7 @@ describe Hydra::Collections::SearchService do
|
|
35
35
|
@service = Hydra::Collections::SearchService.new({}, '')
|
36
36
|
params = @service.apply_gated_search({}, {})
|
37
37
|
@public_query = params[:fq].first.split(' OR ')[0]
|
38
|
-
@public_query.
|
38
|
+
expect(@public_query).to eq('edit_group_customfield:public')
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
require 'spec_helper'
|
16
16
|
|
17
|
-
describe Collection do
|
17
|
+
describe Collection, :type => :model do
|
18
18
|
before(:all) do
|
19
19
|
@user = FactoryGirl.find_or_create(:user)
|
20
20
|
class GenericFile < ActiveFedora::Base
|
@@ -45,20 +45,20 @@ describe Collection do
|
|
45
45
|
@gf2.destroy
|
46
46
|
end
|
47
47
|
it "should have a depositor" do
|
48
|
-
@collection.depositor.
|
48
|
+
expect(@collection.depositor).to eq(@user.user_key)
|
49
49
|
end
|
50
50
|
it "should allow the depositor to edit and read" do
|
51
51
|
ability = Ability.new(@user)
|
52
|
-
ability.can?(:read, @collection).
|
53
|
-
ability.can?(:edit, @collection).
|
52
|
+
expect(ability.can?(:read, @collection)).to eq(true)
|
53
|
+
expect(ability.can?(:edit, @collection)).to eq(true)
|
54
54
|
end
|
55
55
|
it "should be empty by default" do
|
56
|
-
@collection.members.
|
56
|
+
expect(@collection.members).to be_empty
|
57
57
|
end
|
58
58
|
it "should have many files" do
|
59
59
|
@collection.members = [@gf1, @gf2]
|
60
60
|
@collection.save
|
61
|
-
Collection.find(@collection.pid).members.
|
61
|
+
expect(Collection.find(@collection.pid).members).to eq([@gf1, @gf2])
|
62
62
|
end
|
63
63
|
it "should allow new files to be added" do
|
64
64
|
@collection.members = [@gf1]
|
@@ -66,47 +66,58 @@ describe Collection do
|
|
66
66
|
@collection = Collection.find(@collection.pid)
|
67
67
|
@collection.members << @gf2
|
68
68
|
@collection.save
|
69
|
-
Collection.find(@collection.pid).members.
|
69
|
+
expect(Collection.find(@collection.pid).members).to eq([@gf1, @gf2])
|
70
|
+
end
|
71
|
+
it "should allow files to be removed" do
|
72
|
+
@collection.members = [@gf1, @gf2]
|
73
|
+
@collection.save
|
74
|
+
solr_doc_before_remove = ActiveFedora::SolrInstanceLoader.new(ActiveFedora::Base, @gf1.pid).send(:solr_doc)
|
75
|
+
expect(solr_doc_before_remove["collection_tesim"]).to eq([@collection.pid])
|
76
|
+
@collection.reload.members.delete(@gf1)
|
77
|
+
@collection.save
|
78
|
+
expect(Collection.find(@collection.pid).members).to eq([@gf2])
|
79
|
+
solr_doc_after_remove = ActiveFedora::SolrInstanceLoader.new(ActiveFedora::Base, @gf1.pid).send(:solr_doc)
|
80
|
+
expect(solr_doc_after_remove["collection_tesim"]).to be_nil
|
70
81
|
end
|
71
82
|
it "should set the date uploaded on create" do
|
72
83
|
@collection.save
|
73
|
-
@collection.date_uploaded.
|
84
|
+
expect(@collection.date_uploaded).to be_kind_of(Date)
|
74
85
|
end
|
75
86
|
it "should update the date modified on update" do
|
76
87
|
uploaded_date = Date.today
|
77
88
|
modified_date = Date.tomorrow
|
78
|
-
Date.
|
89
|
+
allow(Date).to receive(:today).and_return(uploaded_date, modified_date)
|
79
90
|
@collection.save
|
80
|
-
@collection.date_modified.
|
91
|
+
expect(@collection.date_modified).to eq(uploaded_date)
|
81
92
|
@collection.members = [@gf1]
|
82
93
|
@collection.save
|
83
|
-
@collection.date_modified.
|
94
|
+
expect(@collection.date_modified).to eq(modified_date)
|
84
95
|
@gf1 = @gf1.reload
|
85
|
-
@gf1.collections.
|
86
|
-
@gf1.to_solr[Solrizer.solr_name(:collection)].
|
96
|
+
expect(@gf1.collections).to include(@collection)
|
97
|
+
expect(@gf1.to_solr[Solrizer.solr_name(:collection)]).to eq([@collection.id])
|
87
98
|
end
|
88
99
|
it "should have a title" do
|
89
100
|
@collection.title = "title"
|
90
101
|
@collection.save
|
91
|
-
Collection.find(@collection.pid).title.
|
102
|
+
expect(Collection.find(@collection.pid).title).to eq(@collection.title)
|
92
103
|
end
|
93
104
|
it "should have a description" do
|
94
105
|
@collection.description = "description"
|
95
106
|
@collection.save
|
96
|
-
Collection.find(@collection.pid).description.
|
107
|
+
expect(Collection.find(@collection.pid).description).to eq(@collection.description)
|
97
108
|
end
|
98
109
|
it "should have the expected display terms" do
|
99
|
-
@collection.terms_for_display.
|
110
|
+
expect(@collection.terms_for_display).to eq([:part_of, :contributor, :creator, :title, :description, :publisher, :date_created, :date_uploaded, :date_modified, :subject, :language, :rights, :resource_type, :identifier, :based_near, :tag, :related_url])
|
100
111
|
end
|
101
112
|
it "should have the expected edit terms" do
|
102
|
-
@collection.terms_for_editing.
|
113
|
+
expect(@collection.terms_for_editing).to eq([:part_of, :contributor, :creator, :title, :description, :publisher, :date_created, :subject, :language, :rights, :resource_type, :identifier, :based_near, :tag, :related_url])
|
103
114
|
end
|
104
115
|
it "should not delete member files when deleted" do
|
105
116
|
@collection.members = [@gf1, @gf2]
|
106
117
|
@collection.save
|
107
118
|
@collection.destroy
|
108
|
-
GenericFile.exists?(@gf1.pid).
|
109
|
-
GenericFile.exists?(@gf2.pid).
|
119
|
+
expect(GenericFile.exists?(@gf1.pid)).to be_truthy
|
120
|
+
expect(GenericFile.exists?(@gf2.pid)).to be_truthy
|
110
121
|
end
|
111
122
|
|
112
123
|
describe "Collection by another name" do
|
@@ -130,7 +141,7 @@ describe Collection do
|
|
130
141
|
collection.members << member
|
131
142
|
collection.save
|
132
143
|
member.reload
|
133
|
-
member.collections.
|
144
|
+
expect(member.collections).to eq([collection])
|
134
145
|
collection.destroy
|
135
146
|
member.destroy
|
136
147
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -20,7 +20,6 @@ RSpec.configure do |config|
|
|
20
20
|
config.include Devise::TestHelpers, :type => :controller
|
21
21
|
config.before(:each, :type=>"controller") { @routes = Hydra::Collections::Engine.routes }
|
22
22
|
config.include EngineRoutes, :type => :controller
|
23
|
-
config.infer_spec_type_from_file_location!
|
24
23
|
end
|
25
24
|
|
26
25
|
module FactoryGirl
|
metadata
CHANGED
@@ -1,85 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-collections
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carolyn Cole
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: hydra-head
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '7.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '7.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '0'
|
83
83
|
description: A rails engine for managing Hydra Collections
|
84
84
|
email:
|
85
85
|
- cam156@psu.edu
|
@@ -87,11 +87,9 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
-
- .gitignore
|
91
|
-
- .gitmodules
|
92
|
-
- .
|
93
|
-
- .ruby-version
|
94
|
-
- .travis.yml
|
90
|
+
- ".gitignore"
|
91
|
+
- ".gitmodules"
|
92
|
+
- ".travis.yml"
|
95
93
|
- CONTRIBUTING.md
|
96
94
|
- Changelog.md
|
97
95
|
- Gemfile
|
@@ -179,17 +177,17 @@ require_paths:
|
|
179
177
|
- lib
|
180
178
|
required_ruby_version: !ruby/object:Gem::Requirement
|
181
179
|
requirements:
|
182
|
-
- -
|
180
|
+
- - ">="
|
183
181
|
- !ruby/object:Gem::Version
|
184
182
|
version: '0'
|
185
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
184
|
requirements:
|
187
|
-
- -
|
185
|
+
- - ">="
|
188
186
|
- !ruby/object:Gem::Version
|
189
187
|
version: '0'
|
190
188
|
requirements: []
|
191
189
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.
|
190
|
+
rubygems_version: 2.2.2
|
193
191
|
signing_key:
|
194
192
|
specification_version: 4
|
195
193
|
summary: A rails engine for managing Hydra Collections
|
@@ -216,4 +214,3 @@ test_files:
|
|
216
214
|
- spec/support/db/migrate/20111101221803_create_searches.rb
|
217
215
|
- spec/support/lib/generators/test_app_generator.rb
|
218
216
|
- spec/support/lib/tasks/rspec.rake
|
219
|
-
has_rdoc:
|